diff options
author | chriseth <chris@ethereum.org> | 2018-06-27 16:35:38 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-06-27 16:37:46 +0800 |
commit | 01fd5a8d51d1a950349fc7467454183cc5d0f145 (patch) | |
tree | d5eb024dd73e21b54e2c546516aa53f3b53e677d /test/compilationTests/gnosis/Markets | |
parent | b9d035264d924ca63472a6be0af287dec75c4355 (diff) | |
download | dexon-solidity-01fd5a8d51d1a950349fc7467454183cc5d0f145.tar.gz dexon-solidity-01fd5a8d51d1a950349fc7467454183cc5d0f145.tar.zst dexon-solidity-01fd5a8d51d1a950349fc7467454183cc5d0f145.zip |
Add emit keyword to compilation tests.
Diffstat (limited to 'test/compilationTests/gnosis/Markets')
4 files changed, 13 insertions, 13 deletions
diff --git a/test/compilationTests/gnosis/Markets/Campaign.sol b/test/compilationTests/gnosis/Markets/Campaign.sol index d2e841b1..f99ede53 100644 --- a/test/compilationTests/gnosis/Markets/Campaign.sol +++ b/test/compilationTests/gnosis/Markets/Campaign.sol @@ -111,7 +111,7 @@ contract Campaign { contributions[msg.sender] = contributions[msg.sender].add(amount); if (amount == maxAmount) stage = Stages.AuctionSuccessful; - CampaignFunding(msg.sender, amount); + emit CampaignFunding(msg.sender, amount); } /// @dev Withdraws refund amount @@ -126,7 +126,7 @@ contract Campaign { contributions[msg.sender] = 0; // Refund collateral tokens require(eventContract.collateralToken().transfer(msg.sender, refundAmount)); - CampaignRefund(msg.sender, refundAmount); + emit CampaignRefund(msg.sender, refundAmount); } /// @dev Allows to create market after successful funding @@ -141,7 +141,7 @@ contract Campaign { require(eventContract.collateralToken().approve(market, funding)); market.fund(funding); stage = Stages.MarketCreated; - MarketCreation(market); + emit MarketCreation(market); return market; } @@ -158,7 +158,7 @@ contract Campaign { eventContract.redeemWinnings(); finalBalance = eventContract.collateralToken().balanceOf(this); stage = Stages.MarketClosed; - MarketClosing(); + emit MarketClosing(); } /// @dev Allows to withdraw fees from campaign contract to contributor @@ -172,6 +172,6 @@ contract Campaign { contributions[msg.sender] = 0; // Send fee share to contributor require(eventContract.collateralToken().transfer(msg.sender, fees)); - FeeWithdrawal(msg.sender, fees); + emit FeeWithdrawal(msg.sender, fees); } } diff --git a/test/compilationTests/gnosis/Markets/CampaignFactory.sol b/test/compilationTests/gnosis/Markets/CampaignFactory.sol index 930ec2e2..d80d7d63 100644 --- a/test/compilationTests/gnosis/Markets/CampaignFactory.sol +++ b/test/compilationTests/gnosis/Markets/CampaignFactory.sol @@ -34,6 +34,6 @@ contract CampaignFactory { returns (Campaign campaign) { campaign = new Campaign(eventContract, marketFactory, marketMaker, fee, funding, deadline); - CampaignCreation(msg.sender, campaign, eventContract, marketFactory, marketMaker, fee, funding, deadline); + emit CampaignCreation(msg.sender, campaign, eventContract, marketFactory, marketMaker, fee, funding, deadline); } } diff --git a/test/compilationTests/gnosis/Markets/StandardMarket.sol b/test/compilationTests/gnosis/Markets/StandardMarket.sol index fc384d3a..84f30386 100644 --- a/test/compilationTests/gnosis/Markets/StandardMarket.sol +++ b/test/compilationTests/gnosis/Markets/StandardMarket.sol @@ -65,7 +65,7 @@ contract StandardMarket is Market { eventContract.buyAllOutcomes(_funding); funding = _funding; stage = Stages.MarketFunded; - MarketFunding(funding); + emit MarketFunding(funding); } /// @dev Allows market creator to close the markets by transferring all remaining outcome tokens to the creator @@ -78,7 +78,7 @@ contract StandardMarket is Market { for (uint8 i = 0; i < outcomeCount; i++) require(eventContract.outcomeTokens(i).transfer(creator, eventContract.outcomeTokens(i).balanceOf(this))); stage = Stages.MarketClosed; - MarketClosing(); + emit MarketClosing(); } /// @dev Allows market creator to withdraw fees generated by trades @@ -91,7 +91,7 @@ contract StandardMarket is Market { fees = eventContract.collateralToken().balanceOf(this); // Transfer fees require(eventContract.collateralToken().transfer(creator, fees)); - FeeWithdrawal(fees); + emit FeeWithdrawal(fees); } /// @dev Allows to buy outcome tokens from market maker @@ -121,7 +121,7 @@ contract StandardMarket is Market { // Add outcome token count to market maker net balance require(int(outcomeTokenCount) >= 0); netOutcomeTokensSold[outcomeTokenIndex] = netOutcomeTokensSold[outcomeTokenIndex].add(int(outcomeTokenCount)); - OutcomeTokenPurchase(msg.sender, outcomeTokenIndex, outcomeTokenCount, cost); + emit OutcomeTokenPurchase(msg.sender, outcomeTokenIndex, outcomeTokenCount, cost); } /// @dev Allows to sell outcome tokens to market maker @@ -150,7 +150,7 @@ contract StandardMarket is Market { // Subtract outcome token count from market maker net balance require(int(outcomeTokenCount) >= 0); netOutcomeTokensSold[outcomeTokenIndex] = netOutcomeTokensSold[outcomeTokenIndex].sub(int(outcomeTokenCount)); - OutcomeTokenSale(msg.sender, outcomeTokenIndex, outcomeTokenCount, profit); + emit OutcomeTokenSale(msg.sender, outcomeTokenIndex, outcomeTokenCount, profit); } /// @dev Buys all outcomes, then sells all shares of selected outcome which were bought, keeping @@ -178,7 +178,7 @@ contract StandardMarket is Market { require(eventContract.outcomeTokens(i).transfer(msg.sender, outcomeTokenCount)); // Send change back to buyer require(eventContract.collateralToken().transfer(msg.sender, profit)); - OutcomeTokenShortSale(msg.sender, outcomeTokenIndex, outcomeTokenCount, cost); + emit OutcomeTokenShortSale(msg.sender, outcomeTokenIndex, outcomeTokenCount, cost); } /// @dev Calculates fee to be paid to market maker diff --git a/test/compilationTests/gnosis/Markets/StandardMarketFactory.sol b/test/compilationTests/gnosis/Markets/StandardMarketFactory.sol index 101c37a2..88dcbe79 100644 --- a/test/compilationTests/gnosis/Markets/StandardMarketFactory.sol +++ b/test/compilationTests/gnosis/Markets/StandardMarketFactory.sol @@ -20,6 +20,6 @@ contract StandardMarketFactory is MarketFactory { returns (Market market) { market = new StandardMarket(msg.sender, eventContract, marketMaker, fee); - MarketCreation(msg.sender, market, eventContract, marketMaker, fee); + emit MarketCreation(msg.sender, market, eventContract, marketMaker, fee); } } |