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
774dd1b9
Unverified
Commit
774dd1b9
authored
Oct 27, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
safe-tools: Fix bug in getPrevOwners
parent
5f56bd2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
SafeTestTools.sol
packages/contracts-bedrock/test/safe-tools/SafeTestTools.sol
+2
-9
No files found.
packages/contracts-bedrock/test/safe-tools/SafeTestTools.sol
View file @
774dd1b9
...
@@ -199,14 +199,7 @@ library SafeTestLib {
...
@@ -199,14 +199,7 @@ library SafeTestLib {
/// @param _owner The owner whose previous owner we want to find
/// @param _owner The owner whose previous owner we want to find
function getPrevOwner(SafeInstance memory instance, address _owner) internal view returns (address prevOwner_) {
function getPrevOwner(SafeInstance memory instance, address _owner) internal view returns (address prevOwner_) {
address[] memory owners = instance.safe.getOwners();
address[] memory owners = instance.safe.getOwners();
for (uint256 i = 0; i < owners.length; i++) {
prevOwner_ = getPrevOwnerFromList(_owner, owners);
if (owners[i] != _owner) continue;
if (i == 0) {
prevOwner_ = SENTINEL_OWNERS;
break;
}
prevOwner_ = owners[i - 1];
}
}
}
/// @dev Get the previous owner in the provided list of owners.
/// @dev Get the previous owner in the provided list of owners.
...
@@ -250,7 +243,7 @@ library SafeTestLib {
...
@@ -250,7 +243,7 @@ library SafeTestLib {
address[] memory currentOwners;
address[] memory currentOwners;
for (uint256 i = 0; i < _ownersToRemove.length; i++) {
for (uint256 i = 0; i < _ownersToRemove.length; i++) {
currentOwners = ownerSimulator.getOwners();
currentOwners = ownerSimulator.getOwners();
prevOwners_[i] = SafeTestLib.getPrevOwnerFromList(
instance.owners
[i], currentOwners);
prevOwners_[i] = SafeTestLib.getPrevOwnerFromList(
_ownersToRemove
[i], currentOwners);
// Don't try to remove the last owner
// Don't try to remove the last owner
if (currentOwners.length == 1) break;
if (currentOwners.length == 1) break;
...
...
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