@@ -59,54 +59,33 @@ contract CheckpointTrackerTest is Test {
59
59
}
60
60
61
61
function test_proveTransition_SuccessfulTransition () public {
62
- ICheckpointTracker.Checkpoint memory start =
63
- ICheckpointTracker.Checkpoint ({publicationId: 0 , commitment: keccak256 (abi.encode ("genesis " ))});
64
62
ICheckpointTracker.Checkpoint memory end =
65
63
ICheckpointTracker.Checkpoint ({publicationId: 3 , commitment: keccak256 (abi.encode ("end " ))});
66
64
uint256 numRelevantPublications = 2 ;
67
65
68
66
vm.expectEmit ();
69
67
emit ICheckpointTracker.CheckpointUpdated (end);
70
- tracker.proveTransition (start, end, numRelevantPublications, proof);
68
+
69
+ // Empty checkpoint needed to comply with the interface, but not used in `CheckpointTracker`
70
+ ICheckpointTracker.Checkpoint memory emptyCheckpoint =
71
+ ICheckpointTracker.Checkpoint ({publicationId: 0 , commitment: bytes32 (0 )});
72
+ tracker.proveTransition (emptyCheckpoint, end, numRelevantPublications, proof);
71
73
72
74
ICheckpointTracker.Checkpoint memory provenCheckpoint = tracker.getProvenCheckpoint ();
73
75
assertEq (provenCheckpoint.publicationId, end.publicationId);
74
76
assertEq (provenCheckpoint.commitment, end.commitment);
75
77
}
76
78
77
79
function test_proveTransition_RevertWhenEndCommitmentIsZero () public {
78
- ICheckpointTracker.Checkpoint memory start =
79
- ICheckpointTracker.Checkpoint ({publicationId: 0 , commitment: keccak256 (abi.encode ("genesis " ))});
80
80
ICheckpointTracker.Checkpoint memory end =
81
81
ICheckpointTracker.Checkpoint ({publicationId: 3 , commitment: bytes32 (0 )});
82
82
uint256 numRelevantPublications = 2 ;
83
83
84
84
vm.expectRevert ("Checkpoint commitment cannot be 0 " );
85
- tracker.proveTransition (start, end, numRelevantPublications, proof);
86
- }
87
-
88
- function test_proveTransition_RevertWhenStartCheckpointNotLatestProven () public {
89
- ICheckpointTracker.Checkpoint memory start =
90
- ICheckpointTracker.Checkpoint ({publicationId: 1 , commitment: keccak256 (abi.encode ("wrong " ))});
91
- ICheckpointTracker.Checkpoint memory end =
92
- ICheckpointTracker.Checkpoint ({publicationId: 3 , commitment: keccak256 (abi.encode ("end " ))});
93
- uint256 numRelevantPublications = 2 ;
94
-
95
- vm.expectRevert ("Start checkpoint must be the latest proven checkpoint " );
96
- tracker.proveTransition (start, end, numRelevantPublications, proof);
97
- }
98
-
99
- function test_proveTransition_RevertWhenEndPublicationNotAfterStart () public {
100
- ICheckpointTracker.Checkpoint memory start =
101
- ICheckpointTracker.Checkpoint ({publicationId: 0 , commitment: keccak256 (abi.encode ("genesis " ))});
102
- ICheckpointTracker.Checkpoint memory end =
103
- ICheckpointTracker.Checkpoint ({publicationId: 0 , commitment: keccak256 (abi.encode ("end " ))});
104
- // this is nonsensical, but we're testing the publicationId check so I think it makes sense for the other
105
- // parameters to match previous tests.
106
- uint256 numRelevantPublications = 2 ;
107
-
108
- vm.expectRevert ("End publication must be after the last proven publication " );
109
- tracker.proveTransition (start, end, numRelevantPublications, proof);
85
+ // Empty checkpoint needed to comply with the interface, but not used in `CheckpointTracker`
86
+ ICheckpointTracker.Checkpoint memory emptyCheckpoint =
87
+ ICheckpointTracker.Checkpoint ({publicationId: 0 , commitment: bytes32 (0 )});
88
+ tracker.proveTransition (emptyCheckpoint, end, numRelevantPublications, proof);
110
89
}
111
90
112
91
function createSampleFeed () private {
0 commit comments