Skip to content

Conversation

@JustXxx
Copy link

@JustXxx JustXxx commented Aug 7, 2024

forge test --mc FaultDisputeGameN.*

Ran 4 tests for test/dispute/FaultDisputeGameN.t.sol:FaultDisputeGameN_LessSplitDepth_Test
[PASS] test_move_clockExtensionCorrectnessOne_succeeds() (gas: 259345)
[PASS] test_stepAttackDummyClaim_attackBranch3WithNonRootclaim_reverts() (gas: 1013034)
[PASS] test_stepAttackDummyClaim_attackBranch3WithNonRootclaim_succeeds() (gas: 1016056)
[PASS] test_stepAttackDummyClaim_attackRightMostBranchWithNonRootclaim_reverts() (gas: 1011670)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 336.90ms (5.69ms CPU time)
2024-08-07T01:52:24.868109Z  INFO run_tests{name="FaultDisputeGameN_Test"}: forge::runner: done. 70/70 successful duration=700.688294ms

Ran 70 tests for test/dispute/FaultDisputeGameN.t.sol:FaultDisputeGameN_Test
[PASS] testFuzz_addLocalData_oob_reverts(uint256) (runs: 66, μ: 697072, ~: 697072)
[PASS] testFuzz_challengeRootL2Block_receivesBond_succeeds(bytes32,bytes32,uint256) (runs: 66, μ: 907150, ~: 907135)
[PASS] testFuzz_challengeRootL2Block_rightBlockNumber_reverts(bytes32,bytes32,uint256) (runs: 66, μ: 489034, ~: 489031)
[PASS] testFuzz_challengeRootL2Block_succeeds(bytes32,bytes32,uint256) (runs: 66, μ: 490153, ~: 490153)
[PASS] testFuzz_constructor_clockExtensionTooLong_reverts(uint64,uint64) (runs: 66, μ: 3629813, ~: 3629925)
[PASS] testFuzz_constructor_invalidSplitDepth_reverts(uint256) (runs: 66, μ: 3627940, ~: 3627923)
[PASS] testFuzz_constructor_maxDepthTooLarge_reverts(uint256) (runs: 66, μ: 3628059, ~: 3628036)
[PASS] testFuzz_initialize_badExtraData_reverts(uint256) (runs: 66, μ: 2682570, ~: 2873075)
[PASS] testFuzz_initialize_cannotProposeGenesis_reverts(uint256) (runs: 66, μ: 149760, ~: 149764)
[PASS] test_addLocalDataGenesisTransition_static_succeeds() (gas: 1374152)
[PASS] test_addLocalDataMiddle_static_succeeds() (gas: 1394923)
[PASS] test_addLocalKey_AttackBranch0_succeeds() (gas: 1065601)
[PASS] test_addLocalKey_AttackBranch1_succeeds() (gas: 1068367)
[PASS] test_addLocalKey_AttackBranch2_succeeds() (gas: 1068334)
[PASS] test_addLocalKey_AttackBranch3_succeeds() (gas: 1068660)
[PASS] test_addLocalKey_AttackRightMidBranch_succeeds() (gas: 1068147)
[PASS] test_addLocalKey_AttackRightMostBranch_succeeds() (gas: 1063838)
[PASS] test_challengeRootL2Block_badHeaderRLPBlockNumberLength_reverts() (gas: 351311)
[PASS] test_challengeRootL2Block_badHeaderRLP_reverts() (gas: 337332)
[PASS] test_challengeRootL2Block_badProof_reverts() (gas: 14567)
[PASS] test_claimCredit_claimAlreadyResolved_reverts() (gas: 835618)
[PASS] test_createdAt_succeeds() (gas: 13344)
[PASS] test_cwiaCalldata_userCannotControlSelector_succeeds() (gas: 24680)
[PASS] test_extraData_succeeds() (gas: 17471)
[PASS] test_gameData_succeeds() (gas: 18568)
[PASS] test_gameType_succeeds() (gas: 11247)
[PASS] test_getRequiredBond_outOfBounds_reverts() (gas: 12487)
[PASS] test_getRequiredBond_succeeds() (gas: 36727)
[PASS] test_initialize_correctData_succeeds() (gas: 32322)
[PASS] test_initialize_onlyOnce_succeeds() (gas: 13168)
[PASS] test_initialize_receivesETH_succeeds() (gas: 348603)
[PASS] test_move_clockCorrectness_succeeds() (gas: 915410)
[PASS] test_move_clockExtensionCorrectnessSplitGrandChild_succeeds() (gas: 259717)
[PASS] test_move_clockTimeExceeded_reverts() (gas: 48762)
[PASS] test_move_correctStatusExecRootForLastAttackBranch_succeeds() (gas: 661996)
[PASS] test_move_correctStatusExecRoot_succeeds() (gas: 681160)
[PASS] test_move_defendRoot_reverts() (gas: 29738)
[PASS] test_move_duplicateClaim_reverts() (gas: 265369)
[PASS] test_move_duplicateClaimsDifferentSubgames_succeeds() (gas: 841760)
[PASS] test_move_gameDepthExceeded_reverts() (gas: 913686)
[PASS] test_move_gameNotInProgress_reverts() (gas: 26249)
[PASS] test_move_incorrectBondAmount_reverts() (gas: 33292)
[PASS] test_move_incorrectDisputedIndex_reverts() (gas: 267243)
[PASS] test_move_incorrectStatusExecRoot_reverts() (gas: 488594)
[PASS] test_move_nonExistentParent_reverts() (gas: 25708)
[PASS] test_move_simpleAttack_succeeds() (gas: 264257)
[PASS] test_resolution_lastSecondDisputes_succeeds() (gas: 973643)
[PASS] test_resolve_bondPayoutsSeveralActors_succeeds() (gas: 1407645)
[PASS] test_resolve_bondPayouts_succeeds() (gas: 1401619)
[PASS] test_resolve_challengeContested_succeeds() (gas: 770832)
[PASS] test_resolve_claimAlreadyResolved_reverts() (gas: 639337)
[PASS] test_resolve_claimAtMaxDepthAlreadyResolved_reverts() (gas: 1010967)
[PASS] test_resolve_invalidStateSameAnchor_succeeds() (gas: 467843)
[PASS] test_resolve_leftmostBondPayout_succeeds() (gas: 1595952)
[PASS] test_resolve_multiPart_succeeds() (gas: 404511065)
[PASS] test_resolve_notInProgress_reverts() (gas: 9832)
[PASS] test_resolve_outOfOrderResolution_reverts() (gas: 478851)
[PASS] test_resolve_rootContested_succeeds() (gas: 456590)
[PASS] test_resolve_rootUncontestedButUnresolved_reverts() (gas: 15914)
[PASS] test_resolve_rootUncontestedClockNotExpired_succeeds() (gas: 21123)
[PASS] test_resolve_rootUncontested_succeeds() (gas: 169864)
[PASS] test_resolve_stepReached_succeeds() (gas: 1341519)
[PASS] test_resolve_teamDeathmatch_succeeds() (gas: 1191007)
[PASS] test_resolve_validNewerStateUpdatesAnchor_succeeds() (gas: 180967)
[PASS] test_resolve_validOlderStateSameAnchor_succeeds() (gas: 152123)
[PASS] test_rootClaim_succeeds() (gas: 11159)
[PASS] test_stepAttackDummyClaim_attackBranch0_succeeds() (gas: 1012622)
[PASS] test_stepAttackDummyClaim_attackBranch1_succeeds() (gas: 1008990)
[PASS] test_stepAttackDummyClaim_attackBranch2_succeeds() (gas: 1008955)
[PASS] test_stepAttackDummyClaim_attackBranch3_succeeds() (gas: 1007051)
Suite result: ok. 70 passed; 0 failed; 0 skipped; finished in 700.69ms (1.87s CPU time)

Ran 2 test suites in 722.62ms (1.04s CPU time): 74 tests passed, 0 failed, 0 skipped (74 total tests)

…st contract has been added to minimize changes in the testing code
@JustXxx JustXxx requested review from dajuguan and qizhou August 7, 2024 01:59
Copy link

@dajuguan dajuguan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All test passed!

@JustXxx JustXxx merged commit cf1424b into bill/unittest_for_step Aug 9, 2024
@JustXxx JustXxx deleted the bill/unittest_test_contract branch August 9, 2024 02:38
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.

3 participants