Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/extensions/CoinMachine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ contract CoinMachine is ColonyExtension, BasicMetaTransaction {

/// @notice Returns the version of the extension
function version() public override pure returns (uint256) {
return 2;
return 3;
}

/// @notice Configures the extension
Expand Down
2 changes: 1 addition & 1 deletion contracts/extensions/EvaluatedExpenditure.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ contract EvaluatedExpenditure is ColonyExtension, BasicMetaTransaction {

/// @notice Returns the version of the extension
function version() public override pure returns (uint256) {
return 1;
return 2;
}

/// @notice Configures the extension
Expand Down
2 changes: 1 addition & 1 deletion contracts/extensions/FundingQueue.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ contract FundingQueue is ColonyExtension, PatriciaTreeProofs, BasicMetaTransacti

/// @notice Returns the version of the extension
function version() public override pure returns (uint256) {
return 2;
return 3;
}

/// @notice Configures the extension
Expand Down
2 changes: 1 addition & 1 deletion contracts/extensions/OneTxPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ contract OneTxPayment is ColonyExtension, BasicMetaTransaction {

/// @notice Returns the version of the extension
function version() public override pure returns (uint256) {
return 2;
return 3;
}

/// @notice Configures the extension
Expand Down
2 changes: 1 addition & 1 deletion contracts/extensions/TokenSupplier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ contract TokenSupplier is ColonyExtension, BasicMetaTransaction {

/// @notice Returns the version of the extension
function version() public override pure returns (uint256) {
return 2;
return 3;
}

/// @notice Configures the extension
Expand Down
2 changes: 1 addition & 1 deletion contracts/extensions/VotingReputation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ contract VotingReputation is ColonyExtension, PatriciaTreeProofs, BasicMetaTrans
/// @notice Return the version number
/// @return The version number
function version() public pure override returns (uint256) {
return 3;
return 4;
}

/// @notice Install the extension
Expand Down
2 changes: 1 addition & 1 deletion contracts/extensions/Whitelist.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ contract Whitelist is ColonyExtension, BasicMetaTransaction {

/// @notice Returns the version of the extension
function version() public override pure returns (uint256) {
return 1;
return 2;
}

/// @notice Configures the extension
Expand Down
27 changes: 21 additions & 6 deletions scripts/versioningCheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ version_from_commit() {
echo $VERSION
}

version_from_commit_extensions() {
COMMIT=$1;
FILE=$2;
VERSION="$(git show $COMMIT:$FILE | grep -A1 'function version() public' | tail -n 1 | sed 's/return //g' | sed 's/;//g' )"
echo $VERSION
}

STATUS=0

if [ $N -ne 0 ]; then
# We need to check if we've bumped the version
# What version does the latest release have
Expand All @@ -20,25 +29,31 @@ if [ $N -ne 0 ]; then

if [ $newVersion -eq $oldVersion ]; then
echo "Version not bumped for Colony.sol when it should be"
exit 1;
STATUS=1;
fi
fi

# Now the same for the extensions
for file in $(git diff --cached --name-only | grep -E 'contracts/extensions/')
for file in $(git diff --cached --name-only $LATEST_RELEASE | grep -E 'contracts/extensions/')
do
if [ $file = "contracts/extensions/ColonyExtension.sol" ]; then
continue
fi

oldVersion="$(version_from_commit $LATEST_RELEASE $file)"
if [ $file = "contracts/extensions/ColonyExtensionMeta.sol" ]; then
continue
fi

oldVersion="$(version_from_commit_extensions $LATEST_RELEASE $file)"

# What version does the staged version have?
newVersion="$(version_from_commit '' $file)"
newVersion="$(version_from_commit_extensions '' $file)"

if [ $newVersion -eq $oldVersion ]; then
echo "Version not bumped for $file when it should be"
exit 1;
STATUS=1;
fi

done
done

exit $STATUS
2 changes: 1 addition & 1 deletion test-smoke/colony-storage-consistent.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ contract("Contract Storage", (accounts) => {
console.log("miningCycleStateHash:", miningCycleAccount.stateRoot.toString("hex"));
console.log("tokenLockingStateHash:", tokenLockingAccount.stateRoot.toString("hex"));

expect(colonyNetworkAccount.stateRoot.toString("hex")).to.equal("099e984edc5c6d9194d5b26a5ec058f2ba341cf591781fe94f65900f9a72fa7a");
expect(colonyNetworkAccount.stateRoot.toString("hex")).to.equal("2775a8fe0a3e55074fbb08308652279918c69e3048ae61e049ed42dd2dfba1ee");
expect(colonyAccount.stateRoot.toString("hex")).to.equal("ba1042d654baa721eb012da81409c1087a9447b8a36b6d844233826e5055fbfe");
expect(metaColonyAccount.stateRoot.toString("hex")).to.equal("352feafb44e40c6097234df1a675c5cd618fd81c0f88e8c6478c838e788bd77a");
expect(miningCycleAccount.stateRoot.toString("hex")).to.equal("474e00d9b002118dee0c336eaf0902b7719bb7d4a877e2d26f6a2452a5a89a6e");
Expand Down
10 changes: 9 additions & 1 deletion test/contracts-network/colony-arbitrary-transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,15 @@ contract("Colony Arbitrary Transactions", (accounts) => {

it("should not be able to make arbitrary transactions to the colony's own extensions", async () => {
const COIN_MACHINE = soliditySha3("CoinMachine");
await colony.installExtension(COIN_MACHINE, 2);

const ethersProvider = new ethers.providers.JsonRpcProvider(web3.currentProvider.host);
const ethersColonyNetwork = new ethers.Contract(colonyNetwork.address, colonyNetwork.abi, ethersProvider);

const eventFilter = ethersColonyNetwork.filters.ExtensionAddedToNetwork(COIN_MACHINE);
const events = await ethersColonyNetwork.queryFilter(eventFilter, 0);
const log = await ethersColonyNetwork.interface.parseLog(events[0]);

await colony.installExtension(COIN_MACHINE, log.args.version);

const coinMachineAddress = await colonyNetwork.getExtensionInstallation(COIN_MACHINE, colony.address);
const coinMachine = await CoinMachine.at(coinMachineAddress);
Expand Down