Skip to content

Commit

Permalink
Merge 34d6fc3 into 7fcfbac
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Elsasser committed Jan 8, 2019
2 parents 7fcfbac + 34d6fc3 commit ff9e983
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 72 deletions.
38 changes: 0 additions & 38 deletions contracts/Linkable.sol

This file was deleted.

3 changes: 1 addition & 2 deletions contracts/MarketContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ contract MarketContract is Creatable {
/// @dev checks our last query price to see if our contract should enter settlement due to it being past our
// expiration date or outside of our tradeable ranges.
function checkSettlement() internal {
if (isSettled) // already settled.
return;
require(!isSettled); // already settled.

uint newSettlementPrice;
if (now > EXPIRATION) { // note: miners can cheat this by small increments of time (minutes, not hours)
Expand Down
24 changes: 24 additions & 0 deletions test/MarketContractRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,30 @@ contract('MarketContractRegistry', function(accounts) {
);
});

it('Cannot re-add white listed contract', async function() {
const ownerAddress = await marketContractRegistry.owner.call();
assert.equal(accounts[0], ownerAddress, "owner isn't our first account");

var isAddressWhiteListed = await marketContractRegistry.isAddressWhiteListed.call(
marketContract.address
);
assert.isTrue(isAddressWhiteListed, 'Deployed Market Contract is not White Listed');

// attempt to add the contract to the whitelist a second time should fail!
let error = null;
try {
await marketContractRegistry.addAddressToWhiteList(marketContract.address, {
from: ownerAddress
});
} catch (err) {
error = err;
}
assert.ok(
error instanceof Error,
"Adding contract to whitelist when its already there didn't fail"
);
});

it('Only owner is able to remove factory address', async function() {
const ownerAddress = await marketContractRegistry.owner.call();
assert.equal(accounts[0], ownerAddress, "owner isn't our first account");
Expand Down
32 changes: 0 additions & 32 deletions test/TestLinkable.sol

This file was deleted.

0 comments on commit ff9e983

Please sign in to comment.