-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa106cc
commit a34de95
Showing
7 changed files
with
86 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
yarn-project/circuit-types/src/messaging/inbox_leaf.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Fr } from '@aztec/circuits.js'; | ||
|
||
import { InboxLeaf } from './inbox_leaf.js'; | ||
|
||
describe('convert index in whole tree to subtree', () => { | ||
it.each([0n, 1n, 15n, 100n])('for 1st l2 block', indexInSubtree => { | ||
const msg = new InboxLeaf(1n, indexInSubtree, Fr.random()); | ||
expect(msg.convertToIndexInSubtree()).toBe(indexInSubtree); | ||
}); | ||
|
||
it.each([0n, 1n, 15n, 100n])('for 2nd block', indexInSubtree => { | ||
const msg = InboxLeaf.createInboxLeafUsingIndexInSubtree(2n, indexInSubtree, Fr.random()); | ||
expect(msg.convertToIndexInSubtree()).toBe(indexInSubtree); | ||
}); | ||
|
||
it.each([0n, 1n, 15n, 100n])('for 100th block', indexInSubtree => { | ||
const msg = InboxLeaf.createInboxLeafUsingIndexInSubtree(100n, indexInSubtree, Fr.random()); | ||
expect(msg.convertToIndexInSubtree()).toBe(indexInSubtree); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters