Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
version coherence test
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Le Bars committed Jul 26, 2018
1 parent aeba4ae commit 609b002
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion contracts/RougeFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 0 additions & 2 deletions contracts/RougeRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import "./RougeRegistryInterface.sol";

contract RougeRegistry is RougeRegistryInterface {

string public version = 'v0.2';

address[] issuers;
address[] all_campaigns;

Expand Down
2 changes: 1 addition & 1 deletion contracts/SimpleRougeCampaign.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions test/RougeFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit 609b002

Please sign in to comment.