aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-22 23:12:17 +0800
committerFabio Berger <me@fabioberger.com>2018-06-22 23:12:17 +0800
commit914b00936199526f67398d5b9823f893f1773cdd (patch)
treed3f22e9e06dde606395728b600ba92dd8166df35 /packages/contracts/src
parentdaa50442c90f30ce7a873bf228875241a083bba5 (diff)
downloaddexon-sol-tools-914b00936199526f67398d5b9823f893f1773cdd.tar
dexon-sol-tools-914b00936199526f67398d5b9823f893f1773cdd.tar.gz
dexon-sol-tools-914b00936199526f67398d5b9823f893f1773cdd.tar.bz2
dexon-sol-tools-914b00936199526f67398d5b9823f893f1773cdd.tar.lz
dexon-sol-tools-914b00936199526f67398d5b9823f893f1773cdd.tar.xz
dexon-sol-tools-914b00936199526f67398d5b9823f893f1773cdd.tar.zst
dexon-sol-tools-914b00936199526f67398d5b9823f893f1773cdd.zip
Change Whitelist error messages to conform to rest and added revert reason checks to transactions tests
Diffstat (limited to 'packages/contracts/src')
-rw-r--r--packages/contracts/src/contracts/current/test/Whitelist/Whitelist.sol10
-rw-r--r--packages/contracts/src/utils/types.ts2
2 files changed, 7 insertions, 5 deletions
diff --git a/packages/contracts/src/contracts/current/test/Whitelist/Whitelist.sol b/packages/contracts/src/contracts/current/test/Whitelist/Whitelist.sol
index d35815474..8b52858b1 100644
--- a/packages/contracts/src/contracts/current/test/Whitelist/Whitelist.sol
+++ b/packages/contracts/src/contracts/current/test/Whitelist/Whitelist.sol
@@ -23,13 +23,13 @@ import "../../protocol/Exchange/interfaces/IExchange.sol";
import "../../protocol/Exchange/libs/LibOrder.sol";
import "../../utils/Ownable/Ownable.sol";
-contract Whitelist is
+contract Whitelist is
Ownable
{
// Revert reasons
- string constant MAKER_NOT_WHITELISTED = "Maker address not whitelisted.";
- string constant TAKER_NOT_WHITELISTED = "Taker address not whitelisted.";
- string constant INVALID_SENDER = "Sender must equal transaction origin.";
+ string constant MAKER_NOT_WHITELISTED = "MAKER_NOT_WHITELISTED"; // Maker address not whitelisted.
+ string constant TAKER_NOT_WHITELISTED = "TAKER_NOT_WHITELISTED"; // Taker address not whitelisted.
+ string constant INVALID_SENDER = "INVALID_SENDER"; // Sender must equal transaction origin.
// Mapping of address => whitelist status.
mapping (address => bool) public isWhitelisted;
@@ -77,7 +77,7 @@ contract Whitelist is
public
{
address takerAddress = msg.sender;
-
+
// This contract must be the entry point for the transaction.
require(
takerAddress == tx.origin,
diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index 24183b549..c1eb72099 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -183,4 +183,6 @@ export enum ContractLibErrors {
IndexOutOfBounds = 'INDEX_OUT_OF_BOUNDS',
AuthorizedAddressMismatch = 'AUTHORIZED_ADDRESS_MISMATCH',
OnlyContractOwner = 'ONLY_CONTRACT_OWNER',
+ MakerNotWhitelisted = 'MAKER_NOT_WHITELISTED',
+ TakerNotWhitelisted = 'TAKER_NOT_WHITELISTED',
}