Skip to content

Commit

Permalink
chore: nit
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaSethi committed May 9, 2024
1 parent 3e0ec4a commit 3a8d25c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/StateReceiver.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ contract('StateReceiver', async (accounts) => {
'!zero'
)
})
it('should not replay zero hashes or invalid proof', async () => {
it('should not replay zero leaf or invalid proof', async () => {
await expectRevert(
testStateReceiver.replayHistoricFailedStateSync(
randomProof(tree.height),
Expand Down Expand Up @@ -423,6 +423,7 @@ contract('StateReceiver', async (accounts) => {
[stateId, receiver, stateData]
] of shuffledFailedStateSyncs) {
const leaf = getLeaf(stateId, receiver, stateData)
assert.isFalse(await testStateReceiver.nullifier(leaf))
const proof = tree.getProofTreeByValue(leaf)
const res = await testStateReceiver.replayHistoricFailedStateSync(
proof,
Expand All @@ -433,12 +434,10 @@ contract('StateReceiver', async (accounts) => {
)
assert.strictEqual(res.logs[0].event, 'StateSyncReplay')
assert.strictEqual(res.logs[0].args.stateId.toNumber(), stateId)

assert.strictEqual(
(await testStateReceiver.replayCount()).toNumber(),
++replayed
)

assert.isTrue(await testStateReceiver.nullifier(leaf))

await expectRevert(
Expand Down Expand Up @@ -470,6 +469,9 @@ contract('StateReceiver', async (accounts) => {
const [stateId, receiver, stateData] = failedStateSyncs[idx]
const leaf = getLeaf(stateId, receiver, stateData)
const proof = tree.getProofTreeByValue(leaf)

assert.isFalse(await testStateReceiver.nullifier(leaf))

const res = await testStateReceiver.replayHistoricFailedStateSync(
proof,
idx,
Expand Down

0 comments on commit 3a8d25c

Please sign in to comment.