Skip to content

Commit

Permalink
changed some error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-iobuilders committed Jul 17, 2019
1 parent ab20f25 commit 21d3341
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Coverage Status](https://coveralls.io/repos/github/IoBuilders/fundable-token/badge.svg?branch=master)](https://coveralls.io/github/IoBuilders/fundable-token?branch=master)
[![npm](https://img.shields.io/npm/v/eip2019.svg)](https://www.npmjs.com/package/eip2019)

This is the work in progress implementation of [EIP-2019 Fundable token](https://github.com/ethereum/EIPs/pull/2019/files). This implementation will change over time with the standard and is not stable at the moment.
This is the reference implementation of [EIP-2019 Fundable token](https://github.com/ethereum/EIPs/pull/2019/files). This implementation will change over time with the standard and is not stable at the moment.

Feedback is appreciated and can given at [the discussion of the EIP](https://github.com/ethereum/EIPs/issues/2019).

Expand Down
8 changes: 4 additions & 4 deletions contracts/Fundable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract Fundable is IFundable, ERC20 {
}

address public tokenOperator;
// walletToFund -> autorized -> true/false
// walletToFund -> authorized -> true/false
mapping(address => mapping(address => bool)) public fundOperators;

mapping(bytes32 => FundableData) private orderedFunds;
Expand Down Expand Up @@ -76,7 +76,7 @@ contract Fundable is IFundable, ERC20 {
function cancelFund(string calldata operationId) external returns (bool) {
FundableData storage fund = orderedFunds[operationId.toHash()];
require(fund.status == FundStatusCode.Ordered, "A fund can only be cancelled in status Ordered");
require(fund.walletToFund == msg.sender || fund.orderer == msg.sender, "Only the wallet who receive the fund can cancel");
require(fund.walletToFund == msg.sender || fund.orderer == msg.sender, "Only the wallet who receives the fund can cancel");
fund.status = FundStatusCode.Cancelled;
emit FundCancelled(fund.orderer, operationId);
return true;
Expand All @@ -85,7 +85,7 @@ contract Fundable is IFundable, ERC20 {
function processFund(string calldata operationId) external returns (bool) {
require(tokenOperator == msg.sender, "A fund can only be processed by the fund operator");
FundableData storage fund = orderedFunds[operationId.toHash()];
require(fund.status == FundStatusCode.Ordered, "Only process if the status is ordered");
require(fund.status == FundStatusCode.Ordered, "A fund can only be put in process from status Ordered");
fund.status = FundStatusCode.InProcess;
emit FundInProcess(fund.orderer, operationId);
return true;
Expand Down Expand Up @@ -148,7 +148,7 @@ contract Fundable is IFundable, ERC20 {
) private returns (bool)
{
require(!instructions.isEmpty(), "Instructions must not be empty");
require(!operationId.isEmpty(), "Operation ID must not be empty");
require(!operationId.isEmpty(), "operationId must not be empty");
require(value > 0, "Value must be greater than zero");

FundableData storage newFund = orderedFunds[operationId.toHash()];
Expand Down
12 changes: 6 additions & 6 deletions test/Fundable.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ contract('Fundable', (accounts) => {
FUNDABLE_INSTRUCTION,
{from: from}
),
'Operation ID must not be empty'
'operationId must not be empty'
);
});

Expand Down Expand Up @@ -141,7 +141,7 @@ contract('Fundable', (accounts) => {
FUNDABLE_INSTRUCTION,
{from: authorizedFundOperator}
),
'Operation ID must not be empty'
'operationId must not be empty'
);
});

Expand Down Expand Up @@ -277,7 +277,7 @@ contract('Fundable', (accounts) => {
operationId,
{from: tokenOperatorAccount}
),
'Only the wallet who receive the fund can cancel'
'Only the wallet who receives the fund can cancel'
);
});

Expand Down Expand Up @@ -464,7 +464,7 @@ contract('Fundable', (accounts) => {
randomString.generate(),
{from: tokenOperatorAccount}
),
'Only process if the status is ordered'
' A fund can only be put in process from status Ordered'
);
});

Expand All @@ -479,7 +479,7 @@ contract('Fundable', (accounts) => {
operationId,
{from: tokenOperatorAccount}
),
'Only process if the status is ordered'
'A fund can only be put in process from status Ordered'
);
});

Expand Down Expand Up @@ -663,5 +663,5 @@ contract('Fundable', (accounts) => {
});
});
});

});

0 comments on commit 21d3341

Please sign in to comment.