From ea913b9d754f4fa8ca82140ede96e5db3ea0d6e8 Mon Sep 17 00:00:00 2001 From: Adam Dossa Date: Wed, 29 May 2019 09:13:04 -0400 Subject: [PATCH] Fix some test cases --- contracts/ModuleRegistry.sol | 4 ---- test/u_module_registry_proxy.js | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/contracts/ModuleRegistry.sol b/contracts/ModuleRegistry.sol index f141fdeff..a11111e9f 100644 --- a/contracts/ModuleRegistry.sol +++ b/contracts/ModuleRegistry.sol @@ -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" @@ -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); diff --git a/test/u_module_registry_proxy.js b/test/u_module_registry_proxy.js index e3447bf27..a1ab58a15 100644 --- a/test/u_module_registry_proxy.js +++ b/test/u_module_registry_proxy.js @@ -257,7 +257,7 @@ 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 () => { @@ -265,7 +265,7 @@ contract("ModuleRegistryProxy", async (accounts) => { 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"); }); });