-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Showing
80 changed files
with
14,358 additions
and
22,367 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Test tree definitions | ||
|
||
Below is the graphical definition of the contract tests implemented on [the test folder](./test) | ||
|
||
``` | ||
TaikoL1Test | ||
βββ When a new TaikoL1 with 10 block slots and a sync interval of 5 | ||
βββ When test1 | ||
β βββ When case-1 | ||
β βββ It initializes the genesis block | ||
β βββ It initializes the first transition | ||
β βββ It finalizes the genesis block | ||
β βββ It counts total blocks as 1 | ||
β βββ It retrieves correct data for the genesis block | ||
β βββ It retrieves correct data for the genesis block's first transition | ||
β βββ It fails to retrieve block 1, indicating block not found | ||
β βββ It returns the genesis block and its first transition for getLastVerifiedTransitionV3 | ||
β βββ It returns empty data for getLastSyncedTransitionV3 but does not revert | ||
βββ When proposing one more block with custom parameters | ||
β βββ When case-2 | ||
β βββ It places the block in the first slot | ||
β βββ It sets the block's next transition id to 1 | ||
β βββ It the returned metahash should match the block's metahash | ||
β βββ It matches the block's timestamp and anchor block id with the parameters | ||
β βββ It total block count is 2 | ||
β βββ It retrieves correct data for block 1 | ||
βββ When proposing one more block with default parameters | ||
β βββ When case-3 | ||
β βββ It places the block in the first slot | ||
β βββ It sets the block's next transition id to 1 | ||
β βββ It the returned metahash should match the block's metahash | ||
β βββ It sets the block's timestamp to the current timestamp | ||
β βββ It sets the block's anchor block id to block.number - 1 | ||
β βββ It total block count is 2 | ||
β βββ It retrieves correct data for block 1 | ||
βββ When proposing one more block with default parameters but nonzero parentMetaHash | ||
β βββ When case-4 | ||
β βββ It does not revert when the first block's parentMetaHash matches the genesis block's metahash | ||
β βββ It reverts when proposing a second block with a random parentMetaHash | ||
βββ When proposing 9 blocks as a batch to fill all slots | ||
βββ When propose the 11th block before previous blocks are verified | ||
β βββ When case-5 | ||
β βββ It reverts indicating no more slots available | ||
βββ When prove all existing blocks with correct first transitions | ||
β βββ When proposing the 11th block after previous blocks are verified | ||
β β βββ When case-6 | ||
β β βββ It total block count is 12 | ||
β β βββ It getBlockV3(0) reverts indicating block not found | ||
β βββ When case-7 | ||
β βββ It total block count is 10 | ||
β βββ It returns the block 9 and its first transition for getLastVerifiedTransitionV3 | ||
β βββ It returns the block 5 and its first transition for getLastSyncedTransitionV3 | ||
βββ When prove all existing blocks with wrong first transitions | ||
β βββ When prove all existing blocks with correct first transitions2 | ||
β β βββ When case-8 | ||
β β βββ It total block count is 10 | ||
β β βββ It returns the block 9 and its first transition for getLastVerifiedTransitionV3 | ||
β β βββ It returns the block 5 and its first transition for getLastSyncedTransitionV3 | ||
β βββ When case-9 | ||
β βββ It total block count is 10 | ||
β βββ It returns the genesis block and its first transition for getLastVerifiedTransitionV3 | ||
β βββ It returns empty data for getLastSyncedTransitionV3 but does not revert | ||
βββ When case-10 | ||
βββ It total block count is 10 | ||
``` |
Oops, something went wrong.