Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
0493c40b
Unverified
Commit
0493c40b
authored
Oct 20, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test(ctb): Fixes and improvements to checkTransaction test
parent
a9312b79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
LivenessGuard.t.sol
packages/contracts-bedrock/test/LivenessGuard.t.sol
+11
-3
No files found.
packages/contracts-bedrock/test/LivenessGuard.t.sol
View file @
0493c40b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
pragma solidity 0.8.15;
pragma solidity 0.8.15;
import { Test } from "forge-std/Test.sol";
import { Test } from "forge-std/Test.sol";
import { Safe } from "safe-contracts/Safe.sol";
import { Safe
, OwnerManager
} from "safe-contracts/Safe.sol";
import { SafeProxyFactory } from "safe-contracts/proxies/SafeProxyFactory.sol";
import { SafeProxyFactory } from "safe-contracts/proxies/SafeProxyFactory.sol";
import { ModuleManager } from "safe-contracts/base/ModuleManager.sol";
import { ModuleManager } from "safe-contracts/base/ModuleManager.sol";
import { Enum } from "safe-contracts/common/Enum.sol";
import { Enum } from "safe-contracts/common/Enum.sol";
...
@@ -37,12 +37,20 @@ contract LivnessGuard_CheckTx_Test is LivnessGuard_TestInit {
...
@@ -37,12 +37,20 @@ contract LivnessGuard_CheckTx_Test is LivnessGuard_TestInit {
using SafeTestLib for SafeInstance;
using SafeTestLib for SafeInstance;
function test_checkTransaction_succeeds() external {
function test_checkTransaction_succeeds() external {
// Create an array of the addresses who will sign the transaction. SafeTestTools
// will generate these signatures up to the threshold by iterating over the owners array.
address[] memory signers = new address[](safeInstance.threshold);
signers[0] = safeInstance.owners[0];
signers[1] = safeInstance.owners[1];
// Don't check topic1 so that we can avoid the ugly txHash calculation.
// Don't check topic1 so that we can avoid the ugly txHash calculation.
vm.expectEmit(false, true, true, true, address(livenessGuard));
vm.expectEmit(false, true, true, true, address(livenessGuard));
emit SignersRecorded(0x0, safeInstance.owners);
emit SignersRecorded(0x0, signers);
vm.expectCall(address(safeInstance.safe), abi.encodeWithSignature("nonce()"));
vm.expectCall(address(safeInstance.safe), abi.encodeCall(OwnerManager.getThreshold, ()));
safeInstance.execTransaction({ to: address(1111), value: 0, data: hex"abba" });
safeInstance.execTransaction({ to: address(1111), value: 0, data: hex"abba" });
for (uint256 i; i < safeInstance.
owners.length
; i++) {
for (uint256 i; i < safeInstance.
threshold
; i++) {
assertEq(livenessGuard.lastSigned(safeInstance.owners[i]), block.timestamp);
assertEq(livenessGuard.lastSigned(safeInstance.owners[i]), block.timestamp);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment