Commit 560a00e0 authored by Anastasios Kalogeropoulos's avatar Anastasios Kalogeropoulos
Browse files

changes for blockchain-dev-env reverted

parent d9e7c1a6
pragma solidity ^0.5.0;
pragma solidity ^0.4.4;
contract Federation {
......@@ -114,4 +114,4 @@ contract Federation {
function checkPolice(address _police) public view returns (bool) {
return polices[_police];
}
}
}
\ No newline at end of file
pragma solidity ^0.5.0;
pragma solidity ^0.4.2;
contract Migrations {
address public owner;
......
pragma solidity ^0.5.0;
pragma solidity ^0.4.4;
import "./Federation.sol";
......@@ -38,7 +38,7 @@ contract ProofOfEmployment is Federation {
}
//function called when landlord initiates employee data verification request to third party
function RequestRequirementVerification(string memory encryptedEmployee, string memory encryptedRequirement, string memory persona, address thirdParty, address landlord) public {
function RequestRequirementVerification(string encryptedEmployee, string encryptedRequirement, string persona, address thirdParty, address landlord) public {
if (compareStrings(persona, "employer")) {
require(checkEmployer(thirdParty));
} else if (compareStrings(persona, "bank")) {
......@@ -57,7 +57,7 @@ contract ProofOfEmployment is Federation {
}
//function called when third party responds to landlord's request to verify employee details
function VerifyRequirement(string memory encryptedEmployee, string memory encryptedResponse, address landlord) public only3rdParty(msg.sender) {
function VerifyRequirement(string encryptedEmployee, string encryptedResponse, address landlord) public only3rdParty(msg.sender) {
emit verificationResponse(encryptedEmployee, encryptedResponse, landlord);
}
......@@ -68,12 +68,12 @@ contract ProofOfEmployment is Federation {
}
// called from the Employee frontend that is watching for the event dataRequestInitiated
function legitimzeDataRequest(address _landlord, string memory _encryptedPartners) public {
function legitimzeDataRequest(address _landlord, string _encryptedPartners) public {
emit employeeLegitimises(msg.sender, _landlord, _encryptedPartners);
}
//function called when landlord uploads contract
function uploadContract(address _employeeAddress, string memory _fileHash) public {
function uploadContract(address _employeeAddress, string _fileHash) public {
require(contracts[_employeeAddress].status == false);
contracts[_employeeAddress].landlord = msg.sender;
contracts[_employeeAddress].ipfsFileHashId = _fileHash;
......@@ -82,19 +82,19 @@ contract ProofOfEmployment is Federation {
}
//function for employee approval for the contract uploaded by landlord
function approveContract(address _landlordAddress, string memory _fileHash) public {
function approveContract(address _landlordAddress, string _fileHash) public {
require(contracts[msg.sender].landlord == _landlordAddress);
require(compareStrings(contracts[msg.sender].ipfsFileHashId, _fileHash));
contracts[msg.sender].status = true;
emit approveContractResponse(msg.sender, _landlordAddress, _fileHash);
}
function compareStrings (string memory a, string memory b) internal pure returns (bool){
return keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b));
function compareStrings (string a, string b) pure returns (bool){
return keccak256(a) == keccak256(b);
}
//function called by the landlord to update the housing authority with the employee/tenant details and contract
function updateHousingAuthority(string memory _name, address _employeeAddress, string memory _employeeName, address _housingAuthority, string memory _fileHash) public {
function updateHousingAuthority(string _name, address _employeeAddress, string _employeeName, address _housingAuthority, string _fileHash) public {
require(housingAuthorities[_housingAuthority] == true);
require(contracts[_employeeAddress].status == true);
require(compareStrings(contracts[_employeeAddress].ipfsFileHashId, _fileHash));
......@@ -102,4 +102,4 @@ contract ProofOfEmployment is Federation {
emit updateHA(_housingAuthority, msg.sender, _name, _employeeAddress, _employeeName, _fileHash);
}
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -72,6 +72,7 @@
"web3": "1.0.0-beta.34",
"pdfjs-dist": "2.0.489",
"bigchaindb-driver": "4.1.0"
},
"scripts": {
"start": "node scripts/start.js",
......
......@@ -283,7 +283,7 @@ function runDevServer(host, port, protocol) {
function run(port) {
var protocol = process.env.HTTPS === 'true' ? "https" : "http";
var host = process.env.HOST || '0.0.0.0';
var host = process.env.HOST || 'localhost';
setupCompiler(host, port, protocol);
runDevServer(host, port, protocol);
}
......
......@@ -27,9 +27,8 @@ function decrypt(usr, encryptedData) {
class Events extends Component {
constructor(props) {
super(props);
this.ipfsApi = new ipfsAPI({ host: '172.16.0.2', port: 5001, protocol: 'http' });;
this.conn = new driver.Connection('http://172.16.0.3:9984/api/v1/', {
this.ipfsApi = ipfsAPI('localhost', '4432');
this.conn = new driver.Connection('https://test.bigchaindb.com/api/v1/', {
app_id: '7e55e3b9',
app_key: 'ee2dec089f59beecb9aa688d3ed3ee2b'
});
......
......@@ -2,14 +2,14 @@ import ProofOfEmployment from './../build/contracts/ProofOfEmployment.json';
import { deployedAddress } from './const.js';
var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.WebsocketProvider('ws://0.0.0.0:8545'));
var web3 = new Web3(new Web3.providers.WebsocketProvider('ws://localhost:8545'));
const drizzleOptions = {
web3: {
block: false,
fallback: {
type: 'ws',
url: 'ws://0.0.0.0:8545'
url: 'ws://127.0.0.1:8545'
}
},
contracts: [
......
......@@ -2,7 +2,7 @@ module.exports = {
migrations_directory: "./migrations",
networks: {
development: {
host: "172.16.0.4",
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
}
......
......@@ -2,7 +2,7 @@ module.exports = {
migrations_directory: "./migrations",
networks: {
development: {
host: "172.16.0.4",
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment