Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename removeOwner to removeOwnerWithThreshold #119

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/base/OwnerManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ contract OwnerManager is SelfAuthorized {
/// @param prevOwner Owner that pointed to the owner to be removed in the linked list
/// @param owner Owner address to be removed.
/// @param _threshold New threshold.
function removeOwner(address prevOwner, address owner, uint256 _threshold)
function removeOwnerWithThreshold(address prevOwner, address owner, uint256 _threshold)
public
authorized
{
Expand Down
8 changes: 4 additions & 4 deletions test/gnosisSafeManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ contract('GnosisSafe', function(accounts) {
assert.deepEqual(await gnosisSafe.getOwners(), [accounts[1], lw.accounts[0], lw.accounts[1], lw.accounts[3]])

// Remove owner and reduce threshold to 2
data = await gnosisSafe.contract.removeOwner.getData(lw.accounts[1], lw.accounts[3], 2)
data = await gnosisSafe.contract.removeOwnerWithThreshold.getData(lw.accounts[1], lw.accounts[3], 2)
let removeTx = await safeUtils.executeTransaction(lw, gnosisSafe, 'remove owner and reduce threshold to 2', [lw.accounts[0], lw.accounts[1], lw.accounts[3]], gnosisSafe.address, 0, data, CALL, executor)
assert.equal(utils.checkTxEvent(removeTx, 'RemovedOwner', gnosisSafe.address, true).args.owner, lw.accounts[3])
assert.equal(utils.checkTxEvent(removeTx, 'ChangedThreshold', gnosisSafe.address, true).args.threshold.toNumber(), 2)
Expand Down Expand Up @@ -94,13 +94,13 @@ contract('GnosisSafe', function(accounts) {
await safeUtils.executeTransaction(lw, gnosisSafe, 'replace with zero account', [lw.accounts[0], lw.accounts[1]], gnosisSafe.address, 0, data, CALL, executor, { fails: true})

// Invalid owner removals
data = await gnosisSafe.contract.removeOwner.getData(sentinel, accounts[0], 1)
data = await gnosisSafe.contract.removeOwnerWithThreshold.getData(sentinel, accounts[0], 1)
await safeUtils.executeTransaction(lw, gnosisSafe, 'remove non-owner', [lw.accounts[0], lw.accounts[1]], gnosisSafe.address, 0, data, CALL, executor, { fails: true})

data = await gnosisSafe.contract.removeOwner.getData(lw.accounts[2], sentinel, 1)
data = await gnosisSafe.contract.removeOwnerWithThreshold.getData(lw.accounts[2], sentinel, 1)
await safeUtils.executeTransaction(lw, gnosisSafe, 'remove sentinel', [lw.accounts[0], lw.accounts[1]], gnosisSafe.address, 0, data, CALL, executor, { fails: true})

data = await gnosisSafe.contract.removeOwner.getData(accounts[1], zeroAcc, 1)
data = await gnosisSafe.contract.removeOwnerWithThreshold.getData(accounts[1], zeroAcc, 1)
await safeUtils.executeTransaction(lw, gnosisSafe, 'remove with zero account', [lw.accounts[0], lw.accounts[1]], gnosisSafe.address, 0, data, CALL, executor, { fails: true})

let executorDiff = await web3.eth.getBalance(executor) - executorBalance
Expand Down
2 changes: 1 addition & 1 deletion test/gnosisSafeSignatureTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ contract('GnosisSafe Without Refund', function(accounts) {
assert.deepEqual(await gnosisSafe.getOwners(), [accounts[5], accounts[0], accounts[1], accounts[3]])

// Remove owner and reduce threshold to 2
data = await gnosisSafe.contract.removeOwner.getData(accounts[1], accounts[3], 2)
data = await gnosisSafe.contract.removeOwnerWithThreshold.getData(accounts[1], accounts[3], 2)
await executeTransaction('remove owner and reduce threshold to 2', [accounts[0], accounts[1], accounts[3]], gnosisSafe.address, 0, data, CALL)
assert.deepEqual(await gnosisSafe.getOwners(), [accounts[5], accounts[0], accounts[1]])
})
Expand Down
2 changes: 1 addition & 1 deletion test/stateChannelModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ contract('StateChannelModule', function(accounts) {
assert.deepEqual(await gnosisSafe.getOwners(), [accounts[1], lw.accounts[0], lw.accounts[1], lw.accounts[3]])

// Remove owner and reduce threshold to 2
data = await gnosisSafe.contract.removeOwner.getData(lw.accounts[1], lw.accounts[3], 2)
data = await gnosisSafe.contract.removeOwnerWithThreshold.getData(lw.accounts[1], lw.accounts[3], 2)
await executeTransaction('remove owner and reduce threshold to 2', [lw.accounts[0], lw.accounts[1], lw.accounts[3]], gnosisSafe.address, 0, data, CALL)
assert.deepEqual(await gnosisSafe.getOwners(), [accounts[1], lw.accounts[0], lw.accounts[1]])
assert.equal(await gnosisSafe.getThreshold(), 2)
Expand Down