Skip to content

Commit a203759

Browse files
committed
Allow existing locks to be cleared
Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
1 parent 07379c3 commit a203759

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

solidity/contracts/lib/zeto_common.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ abstract contract ZetoCommon is OwnableUpgradeable {
5353
lockedProofs[proofHash] == msg.sender,
5454
"Proof already locked by another party"
5555
);
56-
if (delegate != address(0)) {
57-
lockedProofs[proofHash] = delegate;
58-
} else {
59-
lockedProofs[proofHash] = msg.sender;
60-
}
56+
lockedProofs[proofHash] = delegate;
6157
}
6258

6359
function sortInputsAndOutputs(

solidity/test/zkDvP.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,10 @@ describe("DvP flows between fungible and non-fungible tokens based on Zeto with
226226
const utxo1 = newUTXO(100, Alice);
227227
const proof = await zetoAnonTests.prepareProof(circuit1, provingKey1, Alice, [utxo1, ZERO_UTXO], [utxo1, ZERO_UTXO], [Alice, {}]);
228228

229-
await expect(zkPayment.connect(Alice.signer).lockProof(proof.encodedProof, "0x0000000000000000000000000000000000000000")).fulfilled;
229+
await expect(zkPayment.connect(Alice.signer).lockProof(proof.encodedProof, await Alice.signer.getAddress())).fulfilled;
230230
await expect(zkPayment.connect(Bob.signer).lockProof(proof.encodedProof, await Bob.signer.getAddress())).rejectedWith("Proof already locked by another party");
231231
await expect(zkPayment.connect(Alice.signer).lockProof(proof.encodedProof, await Bob.signer.getAddress())).fulfilled;
232+
await expect(zkPayment.connect(Bob.signer).lockProof(proof.encodedProof, "0x0000000000000000000000000000000000000000")).fulfilled;
232233
});
233234
});
234235

0 commit comments

Comments
 (0)