From 609b0025f23a5435c91214e55194c32348d9738d Mon Sep 17 00:00:00 2001 From: Christophe Le Bars Date: Thu, 26 Jul 2018 18:13:31 +0700 Subject: [PATCH] version coherence test --- contracts/RougeFactory.sol | 4 +++- contracts/RougeRegistry.sol | 2 -- contracts/SimpleRougeCampaign.sol | 2 +- test/RougeFactory.js | 5 +++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/contracts/RougeFactory.sol b/contracts/RougeFactory.sol index d82ab01..402dc5b 100644 --- a/contracts/RougeFactory.sol +++ b/contracts/RougeFactory.sol @@ -14,6 +14,8 @@ import "./RougeRegistry.sol"; contract RougeFactory is RougeRegistry { + string public version = '0.8'; + // The Rouge Token contract address RGETokenInterface public rge; uint256 public tare; @@ -41,7 +43,7 @@ contract RougeFactory is RougeRegistry { function createCampaign(address _issuer, uint32 _issuance, uint256 _tokens) public { // only rge contract can call createCampaign - // require(msg.sender == address(rge)); + require(msg.sender == address(rge)); SimpleRougeCampaign c = new SimpleRougeCampaign(_issuer, _issuance, rge, tare, this); diff --git a/contracts/RougeRegistry.sol b/contracts/RougeRegistry.sol index 056a6e7..7187d7e 100644 --- a/contracts/RougeRegistry.sol +++ b/contracts/RougeRegistry.sol @@ -5,8 +5,6 @@ import "./RougeRegistryInterface.sol"; contract RougeRegistry is RougeRegistryInterface { - string public version = 'v0.2'; - address[] issuers; address[] all_campaigns; diff --git a/contracts/SimpleRougeCampaign.sol b/contracts/SimpleRougeCampaign.sol index e62a409..eca3b17 100644 --- a/contracts/SimpleRougeCampaign.sol +++ b/contracts/SimpleRougeCampaign.sol @@ -12,7 +12,7 @@ import "./RougeFactoryInterface.sol"; contract SimpleRougeCampaign { - string public version = 'v0.8'; + string public version = '0.8'; // The Rouge Token contract address RGETokenInterface public rge; diff --git a/test/RougeFactory.js b/test/RougeFactory.js index 09aaf26..03c777f 100644 --- a/test/RougeFactory.js +++ b/test/RougeFactory.js @@ -58,6 +58,11 @@ contract('RougeFactory', function(accounts) { } }) + const factory_version = await factory.version.call(); + const campaign = SimpleRougeCampaign.at(campaign_address); + const campaign_version = await campaign.version.call(); + assert.equal(campaign_version, factory_version, "factory and campaign contract version are the same"); + const issuer_balance_after = await rge.balanceOf.call(issuer); assert.equal(issuer_balance_after.toNumber(), tokens - deposit, "issuer has sent tokens as a deposit to the factory");