Skip to content

Commit

Permalink
Add missing test: pass agent root signed by disputed Notary
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Oct 9, 2023
1 parent 4648af8 commit 7fea1c7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/contracts-core/test/suite/Destination.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,20 @@ contract DestinationTest is ExecutionHubTest {
assertEq(lightManager.agentRoot(), ra._agentRoot);
}

function test_passAgentRoot_whenNotaryInDispute(RawAttestation memory ra, uint32 rootSubmittedAt) public {
bytes32 agentRootLM = lightManager.agentRoot();
vm.assume(ra._agentRoot != agentRootLM);
// Submit attestation that updates `nextAgentRoot`
test_submitAttestation_updatesAgentRoot(ra, rootSubmittedAt);
skip(AGENT_ROOT_OPTIMISTIC_PERIOD);
// Open dispute
openDispute({guard: domains[0].agent, notary: domains[DOMAIN_LOCAL].agent});
// This should remove the pending root
bool rootPending = InterfaceDestination(localDestination()).passAgentRoot();
assertFalse(rootPending);
assertEq(lightManager.agentRoot(), agentRootLM);
}

// ═════════════════════════════════════════════════ GAS DATA ══════════════════════════════════════════════════════

function test_getGasData(Random memory random) public {
Expand Down

0 comments on commit 7fea1c7

Please sign in to comment.