Skip to content

Commit

Permalink
Fix some test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdossa committed May 29, 2019
1 parent 61e2460 commit ea913b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions contracts/ModuleRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage {
uint256 moduleType = getUintValue(Encoder.getKey("registry", _moduleFactory));

require(moduleType != 0, "Module factory should be registered");
// Ordering (lazy evaluation) in below require statement is important. A moduleFactory should not be able
// to prevent the MR owner from removing it by throwing on a call to `owner`
require(
msg.sender == owner() || msg.sender == getAddressValue(Encoder.getKey("factoryOwner", _moduleFactory)),
"msg.sender must be the Module Factory owner or registry curator"
Expand Down Expand Up @@ -284,8 +282,6 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage {
bool isOwner = msg.sender == owner();
bool isFactory = msg.sender == _moduleFactory;
bool isFactoryOwner = msg.sender == getAddressValue(Encoder.getKey("factoryOwner", _moduleFactory));
// Ordering (lazy evaluation) in below require statement is important. A moduleFactory should not be able
// to prevent the MR owner from unverifying it by throwing on a call to `owner`
require(isOwner || isFactory || isFactoryOwner, "Not authorised");
require(getUintValue(Encoder.getKey("registry", _moduleFactory)) != uint256(0), "Module factory must be registered");
set(Encoder.getKey("verified", _moduleFactory), false);
Expand Down
4 changes: 2 additions & 2 deletions test/u_module_registry_proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,15 @@ contract("ModuleRegistryProxy", async (accounts) => {
describe("Execute functionality of the implementation contract on the earlier storage", async () => {
it("Should get the previous data", async () => {
let _data = await I_MRProxied.getFactoryDetails.call(I_GeneralTransferManagerFactory.address);
assert.equal(_data[1].length, new BN(0), "Should give the original length");
assert.equal(_data[2].length, new BN(0), "Should give the original length");
});

it("Should alter the old storage", async () => {
await I_MRProxied.addMoreReputation(I_GeneralTransferManagerFactory.address, [account_polymath, account_temp], {
from: account_polymath
});
let _data = await I_MRProxied.getFactoryDetails.call(I_GeneralTransferManagerFactory.address);
assert.equal(_data[1].length, 2, "Should give the updated length");
assert.equal(_data[2].length, 2, "Should give the updated length");
});
});

Expand Down

0 comments on commit ea913b9

Please sign in to comment.