Skip to content

Commit e251cdc

Browse files
author
Christian Parpart
committed
test: ensure compiled tests do not use var-keyword in preparation of var-keyword removal
1 parent e289c36 commit e251cdc

7 files changed

Lines changed: 75 additions & 84 deletions

test/contracts/AuctionRegistrar.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ contract AuctionSystem {
6767
function onAuctionEnd(string _name) internal;
6868
6969
function bid(string _name, address _bidder, uint _value) internal {
70-
var auction = m_auctions[_name];
70+
Auction storage auction = m_auctions[_name];
7171
if (auction.endDate > 0 && now > auction.endDate)
7272
{
7373
emit AuctionEnded(_name, auction.highestBidder);
@@ -117,9 +117,9 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
117117
}
118118
119119
function onAuctionEnd(string _name) internal {
120-
var auction = m_auctions[_name];
121-
var record = m_toRecord[_name];
122-
var previousOwner = record.owner;
120+
Auction storage auction = m_auctions[_name];
121+
Record storage record = m_toRecord[_name];
122+
address previousOwner = record.owner;
123123
record.renewalDate = now + c_renewalInterval;
124124
record.owner = auction.highestBidder;
125125
emit Changed(_name);

test/contracts/Wallet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ contract multiowned {
119119
// make sure they're an owner
120120
if (ownerIndex == 0) return;
121121
uint ownerIndexBit = 2**ownerIndex;
122-
var pending = m_pending[_operation];
122+
PendingState pending = m_pending[_operation];
123123
if (pending.ownersDone & ownerIndexBit > 0) {
124124
pending.yetNeeded++;
125125
pending.ownersDone -= ownerIndexBit;
@@ -178,7 +178,7 @@ contract multiowned {
178178
}
179179
180180
function hasConfirmed(bytes32 _operation, address _owner) constant returns (bool) {
181-
var pending = m_pending[_operation];
181+
PendingState pending = m_pending[_operation];
182182
uint ownerIndex = m_ownerIndex[uint(_owner)];
183183
184184
// make sure they're an owner
@@ -201,7 +201,7 @@ contract multiowned {
201201
// make sure they're an owner
202202
if (ownerIndex == 0) return;
203203
204-
var pending = m_pending[_operation];
204+
PendingState pending = m_pending[_operation];
205205
// if we're not yet working on this operation, switch over and reset the confirmation status.
206206
if (pending.yetNeeded == 0) {
207207
// reset count of confirmations needed.

test/libsolidity/ABIDecoderTests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ BOOST_AUTO_TEST_CASE(decode_function_type_array)
374374
}
375375
// uses "decode from memory"
376376
function test1_dynamic() public returns (uint) {
377-
var x = new function() external returns (uint)[](3);
377+
function () external returns (uint)[] memory x = new function() external returns (uint)[](4);
378378
x[0] = this.f1;
379379
x[1] = this.f2;
380380
x[2] = this.f3;
@@ -387,7 +387,7 @@ BOOST_AUTO_TEST_CASE(decode_function_type_array)
387387
}
388388
// uses "decode from calldata"
389389
function test2_dynamic() public returns (uint) {
390-
var x = new function() external returns (uint)[](3);
390+
function () external returns (uint)[] memory x = new function() external returns (uint)[](3);
391391
x[0] = this.f1;
392392
x[1] = this.f2;
393393
x[2] = this.f3;
@@ -558,7 +558,7 @@ BOOST_AUTO_TEST_CASE(storage_ptr)
558558
r[2] = 3;
559559
s.x = 11;
560560
s.y = 12;
561-
var (a, b, c, d) = L.f(r, s);
561+
(uint a, uint b, uint c, uint d) = L.f(r, s);
562562
return (r[2], s.x, a, b, c, d);
563563
}
564564
}

0 commit comments

Comments
 (0)