From 5ccddf6d2178bd59a6115d870616beb8a975ea10 Mon Sep 17 00:00:00 2001 From: Frederic Fortier Date: Tue, 6 Feb 2018 14:17:48 -0500 Subject: [PATCH] BLD: removed dummy smart contract --- marketplace/README.md | 18 --------- marketplace/contracts/Marketplace.sol | 19 --------- marketplace/contracts/Migrations.sol | 23 ----------- marketplace/marketplace.iml | 14 ------- marketplace/migrations/1_initial_migration.js | 5 --- marketplace/migrations/2_deploy_contracts.js | 5 --- marketplace/test/TestMarketplace.sol | 39 ------------------- marketplace/truffle-config.js | 4 -- marketplace/truffle.js | 11 ------ 9 files changed, 138 deletions(-) delete mode 100644 marketplace/README.md delete mode 100644 marketplace/contracts/Marketplace.sol delete mode 100644 marketplace/contracts/Migrations.sol delete mode 100644 marketplace/marketplace.iml delete mode 100644 marketplace/migrations/1_initial_migration.js delete mode 100644 marketplace/migrations/2_deploy_contracts.js delete mode 100644 marketplace/test/TestMarketplace.sol delete mode 100644 marketplace/truffle-config.js delete mode 100644 marketplace/truffle.js diff --git a/marketplace/README.md b/marketplace/README.md deleted file mode 100644 index 61f63842..00000000 --- a/marketplace/README.md +++ /dev/null @@ -1,18 +0,0 @@ -This module contains smart contracts for the data marketplace. -It was generated with Truffle. Truffle can be used to compile and test -the smart contracts. It's being tested on a test blockhain using Ganache. - -Steps to test: -* Download and run Ganache -* Ensure that your Ganache endpoint matches `truffle.js` -* In this `marketplace` folder, run the following commands: - * `truffle compile` - * `truffle test` - * `truffle migrate --reset` - * `truffle console` - * From the console: `Marketplace.deployed()` -* The deployed method displays info about the deployed smart contract -including its address. Copy/paste the address into -`catalyst/marketplace/marketplace.py`. -* Run the catalyst marketplace unit tests: -`tests/marketplace/test_marketplace.py` diff --git a/marketplace/contracts/Marketplace.sol b/marketplace/contracts/Marketplace.sol deleted file mode 100644 index 115b6110..00000000 --- a/marketplace/contracts/Marketplace.sol +++ /dev/null @@ -1,19 +0,0 @@ -pragma solidity ^0.4.17; - -contract Marketplace { - address[16] public subscribers; - - // Subscribing to a data source - function subscribe(uint dataSourceId) public returns (uint) { - require(dataSourceId >= 0 && dataSourceId <= 15); - - subscribers[dataSourceId] = msg.sender; - - return dataSourceId; - } - - // Retrieving the subscribers - function getSubscribers() public view returns (address[16]) { - return subscribers; - } -} \ No newline at end of file diff --git a/marketplace/contracts/Migrations.sol b/marketplace/contracts/Migrations.sol deleted file mode 100644 index f170cb4f..00000000 --- a/marketplace/contracts/Migrations.sol +++ /dev/null @@ -1,23 +0,0 @@ -pragma solidity ^0.4.17; - -contract Migrations { - address public owner; - uint public last_completed_migration; - - modifier restricted() { - if (msg.sender == owner) _; - } - - function Migrations() public { - owner = msg.sender; - } - - function setCompleted(uint completed) public restricted { - last_completed_migration = completed; - } - - function upgrade(address new_address) public restricted { - Migrations upgraded = Migrations(new_address); - upgraded.setCompleted(last_completed_migration); - } -} diff --git a/marketplace/marketplace.iml b/marketplace/marketplace.iml deleted file mode 100644 index cf4ef5ed..00000000 --- a/marketplace/marketplace.iml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/marketplace/migrations/1_initial_migration.js b/marketplace/migrations/1_initial_migration.js deleted file mode 100644 index 4d5f3f9b..00000000 --- a/marketplace/migrations/1_initial_migration.js +++ /dev/null @@ -1,5 +0,0 @@ -var Migrations = artifacts.require("./Migrations.sol"); - -module.exports = function(deployer) { - deployer.deploy(Migrations); -}; diff --git a/marketplace/migrations/2_deploy_contracts.js b/marketplace/migrations/2_deploy_contracts.js deleted file mode 100644 index e3935400..00000000 --- a/marketplace/migrations/2_deploy_contracts.js +++ /dev/null @@ -1,5 +0,0 @@ -var Marketplace = artifacts.require ("Marketplace"); - -module.exports = function (deployer) { - deployer.deploy (Marketplace); -}; \ No newline at end of file diff --git a/marketplace/test/TestMarketplace.sol b/marketplace/test/TestMarketplace.sol deleted file mode 100644 index f169d728..00000000 --- a/marketplace/test/TestMarketplace.sol +++ /dev/null @@ -1,39 +0,0 @@ -pragma solidity ^0.4.17; - -import "truffle/Assert.sol"; -import "truffle/DeployedAddresses.sol"; -import "../contracts/Marketplace.sol"; - -contract TestMarketplace { - Marketplace marketplace = Marketplace(DeployedAddresses.Marketplace()); - - // Testing the subscribe() function - function testUserCanSubscribe() public { - uint returnedId = marketplace.subscribe(2); - - uint expected = 2; - - Assert.equal(returnedId, expected, "Data source 2 should be recorded."); - } - - // Testing retrieval of a single subscriber - function testGetSubscriberAddressByDataSourceId() public { - // Expected owner is this contract - address expected = this; - - address subscriber = marketplace.subscribers(2); - - Assert.equal(subscriber, expected, "Subscriber of data source ID 2 should be recorded."); - } - - // Testing retrieval of all subscribers - function testGetSubscriberAddressByDataSourceIdInArray() public { - // Expected subscriber is this contract - address expected = this; - - // Store subscribers in memory rather than contract's storage - address[16] memory subscribers = marketplace.getSubscribers(); - - Assert.equal(subscribers[2], expected, "Subscriber of data source 2 should be recorded."); - } -} \ No newline at end of file diff --git a/marketplace/truffle-config.js b/marketplace/truffle-config.js deleted file mode 100644 index a6330d6d..00000000 --- a/marketplace/truffle-config.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - // See - // to customize your Truffle configuration! -}; diff --git a/marketplace/truffle.js b/marketplace/truffle.js deleted file mode 100644 index 67f2dd44..00000000 --- a/marketplace/truffle.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - // See - // to customize your Truffle configuration! - networks: { - development: { - host: "localhost", - port: 7545, - network_id: "*" // Match any network id - } - } -};