From 5020e186da294df02ba1b0e582e9dd18206bf4ee Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Wed, 18 Sep 2019 15:36:09 +0200 Subject: [PATCH] Adjusts compilation tests to read-only array length. --- test/compilationTests/MultiSigWallet/MultiSigWallet.sol | 2 +- test/compilationTests/corion/moduleHandler.sol | 2 +- test/compilationTests/corion/schelling.sol | 3 ++- test/compilationTests/milestonetracker/MilestoneTracker.sol | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/compilationTests/MultiSigWallet/MultiSigWallet.sol b/test/compilationTests/MultiSigWallet/MultiSigWallet.sol index 48134fe6a..8bf4ebe4b 100644 --- a/test/compilationTests/MultiSigWallet/MultiSigWallet.sol +++ b/test/compilationTests/MultiSigWallet/MultiSigWallet.sol @@ -143,7 +143,7 @@ contract MultiSigWallet { owners[i] = owners[owners.length - 1]; break; } - owners.length -= 1; + owners.pop(); if (required > owners.length) changeRequirement(owners.length); emit OwnerRemoval(owner); diff --git a/test/compilationTests/corion/moduleHandler.sol b/test/compilationTests/corion/moduleHandler.sol index 76061a317..ccbe5ac92 100644 --- a/test/compilationTests/corion/moduleHandler.sol +++ b/test/compilationTests/corion/moduleHandler.sol @@ -77,7 +77,7 @@ contract moduleHandler is multiOwner, announcementTypes { require( success ); if ( ! found ) { id = modules.length; - modules.length++; + modules.push(); } modules[id] = input; } diff --git a/test/compilationTests/corion/schelling.sol b/test/compilationTests/corion/schelling.sol index b70d6797f..51f4727ef 100644 --- a/test/compilationTests/corion/schelling.sol +++ b/test/compilationTests/corion/schelling.sol @@ -46,7 +46,8 @@ contract schellingDB is safeMath, schellingVars { Constructor */ constructor() public { - rounds.length = 2; + rounds.push(); + rounds.push(); rounds[0].blockHeight = block.number; currentSchellingRound = 1; } diff --git a/test/compilationTests/milestonetracker/MilestoneTracker.sol b/test/compilationTests/milestonetracker/MilestoneTracker.sol index 891afcb1e..c222d0a9d 100644 --- a/test/compilationTests/milestonetracker/MilestoneTracker.sol +++ b/test/compilationTests/milestonetracker/MilestoneTracker.sol @@ -227,7 +227,7 @@ contract MilestoneTracker { RLP.RLPItem memory itmProposal = itrProposals.next(); - Milestone storage milestone = milestones[milestones.length ++]; + Milestone storage milestone = milestones.push(); if (!itmProposal.isList()) revert();