Skip to content

Commit

Permalink
Rename removeOwner to removeOwnerWithThreshold
Browse files Browse the repository at this point in the history
Closes #118
  • Loading branch information
Uxio0 committed Aug 8, 2019
1 parent 5c29093 commit a3891de
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
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

0 comments on commit a3891de

Please sign in to comment.