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/corion | |
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/corion')
-rw-r--r-- | test/compilationTests/corion/ico.sol | 2 | ||||
-rw-r--r-- | test/compilationTests/corion/premium.sol | 14 | ||||
-rw-r--r-- | test/compilationTests/corion/provider.sol | 12 | ||||
-rw-r--r-- | test/compilationTests/corion/publisher.sol | 6 | ||||
-rw-r--r-- | test/compilationTests/corion/token.sol | 20 |
5 files changed, 27 insertions, 27 deletions
diff --git a/test/compilationTests/corion/ico.sol b/test/compilationTests/corion/ico.sol index 81a6516e..cb437624 100644 --- a/test/compilationTests/corion/ico.sol +++ b/test/compilationTests/corion/ico.sol @@ -337,7 +337,7 @@ contract ico is safeMath { token(tokenAddr).mint(affilateAddress, extra); } checkPremium(beneficiaryAddress); - EICO(beneficiaryAddress, _reward, affilateAddress, extra); + emit EICO(beneficiaryAddress, _reward, affilateAddress, extra); return true; } diff --git a/test/compilationTests/corion/premium.sol b/test/compilationTests/corion/premium.sol index 9c29e700..5a80ecc6 100644 --- a/test/compilationTests/corion/premium.sol +++ b/test/compilationTests/corion/premium.sol @@ -63,7 +63,7 @@ contract premium is module, safeMath { for ( uint256 a=0 ; a<genesisAddr.length ; a++ ) { genesis[genesisAddr[a]] = true; require( db.increase(genesisAddr[a], genesisValue[a]) ); - Mint(genesisAddr[a], genesisValue[a]); + emit Mint(genesisAddr[a], genesisValue[a]); } } } @@ -137,7 +137,7 @@ contract premium is module, safeMath { require( msg.sender != spender ); require( db.balanceOf(msg.sender) >= amount ); require( db.setAllowance(msg.sender, spender, amount, nonce) ); - Approval(msg.sender, spender, amount); + emit Approval(msg.sender, spender, amount); } function allowance(address owner, address spender) constant returns (uint256 remaining, uint256 nonce) { @@ -178,7 +178,7 @@ contract premium is module, safeMath { } else { _transfer(msg.sender, to, amount); } - Transfer(msg.sender, to, amount, _data); + emit Transfer(msg.sender, to, amount, _data); return true; } @@ -207,7 +207,7 @@ contract premium is module, safeMath { _reamining = safeSub(_reamining, amount); _nonce = safeAdd(_nonce, 1); require( db.setAllowance(from, msg.sender, _reamining, _nonce) ); - AllowanceUsed(msg.sender, from, amount); + emit AllowanceUsed(msg.sender, from, amount); } bytes memory _data; if ( isContract(to) ) { @@ -215,7 +215,7 @@ contract premium is module, safeMath { } else { _transfer( from, to, amount); } - Transfer(from, to, amount, _data); + emit Transfer(from, to, amount, _data); return true; } @@ -242,7 +242,7 @@ contract premium is module, safeMath { } else { _transfer( msg.sender, to, amount); } - Transfer(msg.sender, to, amount, extraData); + emit Transfer(msg.sender, to, amount, extraData); return true; } @@ -301,7 +301,7 @@ contract premium is module, safeMath { @value Amount */ require( db.increase(owner, value) ); - Mint(owner, value); + emit Mint(owner, value); } function isContract(address addr) internal returns (bool success) { diff --git a/test/compilationTests/corion/provider.sol b/test/compilationTests/corion/provider.sol index e6886622..0c1f69e5 100644 --- a/test/compilationTests/corion/provider.sol +++ b/test/compilationTests/corion/provider.sol @@ -268,7 +268,7 @@ contract provider is module, safeMath, announcementTypes { } else { delete providers[msg.sender].data[currHeight].supply[currentSchellingRound]; } - EProviderOpen(msg.sender, currHeight); + emit EProviderOpen(msg.sender, currHeight); } function setProviderDetails(address addr, string website, string country, string info, uint8 rate, address admin) isReady external { /* @@ -297,7 +297,7 @@ contract provider is module, safeMath, announcementTypes { providers[addr].data[currHeight].country = country; providers[addr].data[currHeight].info = info; providers[addr].data[currHeight].currentRate = rate; - EProviderDetailsChanged(addr, currHeight, website, country, info, rate, admin); + emit EProviderDetailsChanged(addr, currHeight, website, country, info, rate, admin); } function getProviderInfo(address addr, uint256 height) public constant returns (string name, string website, string country, string info, uint256 create) { /* @@ -367,7 +367,7 @@ contract provider is module, safeMath, announcementTypes { providers[msg.sender].data[currHeight].valid = false; providers[msg.sender].data[currHeight].close = currentSchellingRound; setRightForInterest(getProviderCurrentSupply(msg.sender), 0, providers[msg.sender].data[currHeight].priv); - EProviderClose(msg.sender, currHeight); + emit EProviderClose(msg.sender, currHeight); } function allowUsers(address provider, address[] addr) isReady external { /* @@ -437,7 +437,7 @@ contract provider is module, safeMath, announcementTypes { clients[msg.sender].paidUpTo = currentSchellingRound; clients[msg.sender].lastRate = providers[provider].data[currHeight].currentRate; clients[msg.sender].providerConnected = now; - ENewClient(msg.sender, provider, currHeight, bal); + emit ENewClient(msg.sender, provider, currHeight, bal); } function partProvider() isReady external { /* @@ -467,7 +467,7 @@ contract provider is module, safeMath, announcementTypes { delete clients[msg.sender].paidUpTo; delete clients[msg.sender].lastRate; delete clients[msg.sender].providerConnected; - EClientLost(msg.sender, provider, currHeight, bal); + emit EClientLost(msg.sender, provider, currHeight, bal); } function checkReward(address addr) public constant returns (uint256 reward) { /* @@ -522,7 +522,7 @@ contract provider is module, safeMath, announcementTypes { if ( providerReward > 0 ) { require( moduleHandler(moduleHandlerAddress).transfer(address(this), provider, providerReward, false) ); } - EReward(msg.sender, provider, clientReward, providerReward); + emit EReward(msg.sender, provider, clientReward, providerReward); } function getClientReward(uint256 limit) internal returns (uint256 reward) { /* diff --git a/test/compilationTests/corion/publisher.sol b/test/compilationTests/corion/publisher.sol index c7baa4df..0e8f825f 100644 --- a/test/compilationTests/corion/publisher.sol +++ b/test/compilationTests/corion/publisher.sol @@ -148,7 +148,7 @@ contract publisher is announcementTypes, module, safeMath { announcements[announcementsLength]._str = _str;
announcements[announcementsLength]._uint = _uint;
announcements[announcementsLength]._addr = _addr;
- ENewAnnouncement(announcementsLength, Type);
+ emit ENewAnnouncement(announcementsLength, Type);
}
function closeAnnouncement(uint256 id) onlyOwner external {
@@ -238,7 +238,7 @@ contract publisher is announcementTypes, module, safeMath { opponents[msg.sender].push(id);
}
announcements[id].oppositionWeight += _balance;
- EOppositeAnnouncement(id, msg.sender, _balance);
+ emit EOppositeAnnouncement(id, msg.sender, _balance);
}
function invalidateAnnouncement(uint256 id) onlyOwner external {
@@ -250,7 +250,7 @@ contract publisher is announcementTypes, module, safeMath { require( announcements[id].open );
announcements[id].end = block.number;
announcements[id].open = false;
- EInvalidateAnnouncement(id);
+ emit EInvalidateAnnouncement(id);
}
modifier onlyOwner() {
diff --git a/test/compilationTests/corion/token.sol b/test/compilationTests/corion/token.sol index bb141b52..0709baca 100644 --- a/test/compilationTests/corion/token.sol +++ b/test/compilationTests/corion/token.sol @@ -78,7 +78,7 @@ contract token is safeMath, module, announcementTypes { genesis[genesisAddr[a]] = true; require( db.increase(genesisAddr[a], genesisValue[a]) ); if ( ! genesisAddr[a].send(0.2 ether) ) {} - Mint(genesisAddr[a], genesisValue[a]); + emit Mint(genesisAddr[a], genesisValue[a]); } } } @@ -152,7 +152,7 @@ contract token is safeMath, module, announcementTypes { require( msg.sender != spender ); require( db.balanceOf(msg.sender) >= amount ); require( db.setAllowance(msg.sender, spender, amount, nonce) ); - Approval(msg.sender, spender, amount); + emit Approval(msg.sender, spender, amount); } function allowance(address owner, address spender) constant returns (uint256 remaining, uint256 nonce) { @@ -193,7 +193,7 @@ contract token is safeMath, module, announcementTypes { } else { _transfer( msg.sender, to, amount, true); } - Transfer(msg.sender, to, amount, _data); + emit Transfer(msg.sender, to, amount, _data); return true; } @@ -222,7 +222,7 @@ contract token is safeMath, module, announcementTypes { _reamining = safeSub(_reamining, amount); _nonce = safeAdd(_nonce, 1); require( db.setAllowance(from, msg.sender, _reamining, _nonce) ); - AllowanceUsed(msg.sender, from, amount); + emit AllowanceUsed(msg.sender, from, amount); } bytes memory _data; if ( isContract(to) ) { @@ -230,7 +230,7 @@ contract token is safeMath, module, announcementTypes { } else { _transfer( from, to, amount, true); } - Transfer(from, to, amount, _data); + emit Transfer(from, to, amount, _data); return true; } @@ -256,7 +256,7 @@ contract token is safeMath, module, announcementTypes { bytes memory _data; require( super.isModuleHandler(msg.sender) ); _transfer( from, to, amount, fee); - Transfer(from, to, amount, _data); + emit Transfer(from, to, amount, _data); return true; } @@ -284,7 +284,7 @@ contract token is safeMath, module, announcementTypes { } else { _transfer( msg.sender, to, amount, true); } - Transfer(msg.sender, to, amount, extraData); + emit Transfer(msg.sender, to, amount, extraData); return true; } @@ -379,7 +379,7 @@ contract token is safeMath, module, announcementTypes { require( db.increase(_schellingAddr, _forSchelling) ); _burn(owner, _forBurn); bytes memory _data; - Transfer(owner, _schellingAddr, _forSchelling, _data); + emit Transfer(owner, _schellingAddr, _forSchelling, _data); require( moduleHandler(moduleHandlerAddress).broadcastTransfer(owner, _schellingAddr, _forSchelling) ); } else { _burn(owner, _fee); @@ -428,7 +428,7 @@ contract token is safeMath, module, announcementTypes { if ( isICO ) { require( ico(icoAddr).setInterestDB(owner, db.balanceOf(owner)) ); } - Mint(owner, value); + emit Mint(owner, value); } function burn(address owner, uint256 value) isReady external returns (bool success) { @@ -454,7 +454,7 @@ contract token is safeMath, module, announcementTypes { */ require( db.decrease(owner, value) ); require( moduleHandler(moduleHandlerAddress).broadcastTransfer(owner, address(0x00), value) ); - Burn(owner, value); + emit Burn(owner, value); } function isContract(address addr) internal returns (bool success) { |