Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the unit test of resolve #50

Merged
merged 6 commits into from
Aug 9, 2024
Merged

fix the unit test of resolve #50

merged 6 commits into from
Aug 9, 2024

Conversation

JustXxx
Copy link

@JustXxx JustXxx commented Aug 4, 2024

forge test --mc FaultDisputeGameN.*

Ran 4 tests for test/dispute/FaultDisputeGameN.t.sol:FaultDisputeGameN_LessSplitDepth_Test
[PASS] test_move_clockExtensionCorrectnessOne_succeeds() (gas: 259451)
[PASS] test_stepAttackDummyClaim_attackBranch3WithNonRootclaim_reverts() (gas: 1023897)
[PASS] test_stepAttackDummyClaim_attackBranch3WithNonRootclaim_succeeds() (gas: 1026915)
[PASS] test_stepAttackDummyClaim_attackRightMostBranchWithNonRootclaim_reverts() (gas: 1022529)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 303.05ms (4.38ms CPU time)
2024-08-04T08:18:45.570749Z  INFO run_tests{name="FaultDisputeGameN_Test"}: forge::runner: done. 70/70 successful duration=597.887293ms

Ran 70 tests for test/dispute/FaultDisputeGameN.t.sol:FaultDisputeGameN_Test
[PASS] testFuzz_addLocalData_oob_reverts(uint256) (runs: 66, μ: 697183, ~: 697183)
[PASS] testFuzz_challengeRootL2Block_receivesBond_succeeds(bytes32,bytes32,uint256) (runs: 66, μ: 907111, ~: 907111)
[PASS] testFuzz_challengeRootL2Block_rightBlockNumber_reverts(bytes32,bytes32,uint256) (runs: 66, μ: 488988, ~: 488988)
[PASS] testFuzz_challengeRootL2Block_succeeds(bytes32,bytes32,uint256) (runs: 66, μ: 490102, ~: 490087)
[PASS] testFuzz_constructor_clockExtensionTooLong_reverts(uint64,uint64) (runs: 66, μ: 3630145, ~: 3629886)
[PASS] testFuzz_constructor_invalidSplitDepth_reverts(uint256) (runs: 66, μ: 3628349, ~: 3628336)
[PASS] testFuzz_constructor_maxDepthTooLarge_reverts(uint256) (runs: 66, μ: 3628462, ~: 3628449)
[PASS] testFuzz_initialize_badExtraData_reverts(uint256) (runs: 66, μ: 2322450, ~: 2397935)
[PASS] testFuzz_initialize_cannotProposeGenesis_reverts(uint256) (runs: 66, μ: 149740, ~: 149742)
[PASS] test_addLocalDataGenesisTransition_static_succeeds() (gas: 1374173)
[PASS] test_addLocalDataMiddle_static_succeeds() (gas: 1394944)
[PASS] test_addLocalKey_AttackBranch0_succeeds() (gas: 1065739)
[PASS] test_addLocalKey_AttackBranch1_succeeds() (gas: 1068505)
[PASS] test_addLocalKey_AttackBranch2_succeeds() (gas: 1068472)
[PASS] test_addLocalKey_AttackBranch3_succeeds() (gas: 1068798)
[PASS] test_addLocalKey_AttackRightMidBranch_succeeds() (gas: 1068285)
[PASS] test_addLocalKey_AttackRightMostBranch_succeeds() (gas: 1063976)
[PASS] test_challengeRootL2Block_badHeaderRLPBlockNumberLength_reverts() (gas: 351289)
[PASS] test_challengeRootL2Block_badHeaderRLP_reverts() (gas: 337310)
[PASS] test_challengeRootL2Block_badProof_reverts() (gas: 14567)
[PASS] test_claimCredit_claimAlreadyResolved_reverts() (gas: 835680)
[PASS] test_createdAt_succeeds() (gas: 13322)
[PASS] test_cwiaCalldata_userCannotControlSelector_succeeds() (gas: 24725)
[PASS] test_extraData_succeeds() (gas: 17471)
[PASS] test_gameData_succeeds() (gas: 18546)
[PASS] test_gameType_succeeds() (gas: 11225)
[PASS] test_getRequiredBond_outOfBounds_reverts() (gas: 12443)
[PASS] test_getRequiredBond_succeeds() (gas: 36859)
[PASS] test_initialize_correctData_succeeds() (gas: 32343)
[PASS] test_initialize_onlyOnce_succeeds() (gas: 13146)
[PASS] test_initialize_receivesETH_succeeds() (gas: 348581)
[PASS] test_move_clockCorrectness_succeeds() (gas: 915793)
[PASS] test_move_clockExtensionCorrectnessSplitGrandChild_succeeds() (gas: 259823)
[PASS] test_move_clockTimeExceeded_reverts() (gas: 48804)
[PASS] test_move_correctStatusExecRootForLastAttackBranch_succeeds() (gas: 662122)
[PASS] test_move_correctStatusExecRoot_succeeds() (gas: 681286)
[PASS] test_move_defendRoot_reverts() (gas: 29759)
[PASS] test_move_duplicateClaim_reverts() (gas: 265389)
[PASS] test_move_duplicateClaimsDifferentSubgames_succeeds() (gas: 841864)
[PASS] test_move_gameDepthExceeded_reverts() (gas: 913853)
[PASS] test_move_gameNotInProgress_reverts() (gas: 26270)
[PASS] test_move_incorrectBondAmount_reverts() (gas: 33313)
[PASS] test_move_incorrectDisputedIndex_reverts() (gas: 267284)
[PASS] test_move_incorrectStatusExecRoot_reverts() (gas: 488720)
[PASS] test_move_nonExistentParent_reverts() (gas: 25664)
[PASS] test_move_simpleAttack_succeeds() (gas: 264385)
[PASS] test_resolution_lastSecondDisputes_succeeds() (gas: 973460)
[PASS] test_resolve_bondPayoutsSeveralActors_succeeds() (gas: 1419871)
[PASS] test_resolve_bondPayouts_succeeds() (gas: 1413845)
[PASS] test_resolve_challengeContested_succeeds() (gas: 770895)
[PASS] test_resolve_claimAlreadyResolved_reverts() (gas: 639421)
[PASS] test_resolve_claimAtMaxDepthAlreadyResolved_reverts() (gas: 1011267)
[PASS] test_resolve_invalidStateSameAnchor_succeeds() (gas: 467775)
[PASS] test_resolve_leftmostBondPayout_succeeds() (gas: 1596079)
[PASS] test_resolve_multiPart_succeeds() (gas: 404554138)
[PASS] test_resolve_notInProgress_reverts() (gas: 9832)
[PASS] test_resolve_outOfOrderResolution_reverts() (gas: 478935)
[PASS] test_resolve_rootContested_succeeds() (gas: 456588)
[PASS] test_resolve_rootUncontestedButUnresolved_reverts() (gas: 15914)
[PASS] test_resolve_rootUncontestedClockNotExpired_succeeds() (gas: 21123)
[PASS] test_resolve_rootUncontested_succeeds() (gas: 169843)
[PASS] test_resolve_stepReached_succeeds() (gas: 1341777)
[PASS] test_resolve_teamDeathmatch_succeeds() (gas: 1191045)
[PASS] test_resolve_validNewerStateUpdatesAnchor_succeeds() (gas: 180903)
[PASS] test_resolve_validOlderStateSameAnchor_succeeds() (gas: 152057)
[PASS] test_rootClaim_succeeds() (gas: 11204)
[PASS] test_stepAttackDummyClaim_attackBranch0_succeeds() (gas: 1024804)
[PASS] test_stepAttackDummyClaim_attackBranch1_succeeds() (gas: 1021622)
[PASS] test_stepAttackDummyClaim_attackBranch2_succeeds() (gas: 1021587)
[PASS] test_stepAttackDummyClaim_attackBranch3_succeeds() (gas: 1017913)
Suite result: ok. 70 passed; 0 failed; 0 skipped; finished in 597.89ms (1.70s CPU time)

Ran 2 test suites in 618.76ms (900.94ms CPU time): 74 tests passed, 0 failed, 0 skipped (74 total tests)

@JustXxx JustXxx requested review from qizhou and dajuguan August 4, 2024 08:19
billxu and others added 2 commits August 7, 2024 09:52
…st contract has been added to minimize changes in the testing code
The "attack" has been modified to support "da" and the "FaultDisputeGameTest" contract has been added to minimize changes in the testing code
@JustXxx JustXxx merged commit f87be16 into develop Aug 9, 2024
2 checks passed
@JustXxx JustXxx deleted the bill/unittest_for_step branch August 9, 2024 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant