Updated friendsRecovery.js to work with embark

This commit is contained in:
Richard Ramos 2018-03-15 10:41:05 -04:00
parent 8c5b72490f
commit 7235aa85d7
2 changed files with 24 additions and 3 deletions

View File

@ -8,4 +8,26 @@ contract TestContract {
function test() public {
TestFunctionExecuted();
}
/*
Helper function to be used in unit testing due to error in web3
web3.utils.soliditySha3([1, 2, 3])
Error: Autodetection of array types is not supported.
at _processSoliditySha3Args (node_modules/web3-utils/src/soliditySha3.js:176:15)
*/
function hash(
address identity,
bytes32 _revealedSecret,
address _dest,
bytes _data,
bytes32 _newSecret,
bytes32[] _newFriendsHashes)
public
pure
returns(bytes32)
{
return keccak256(identity, _revealedSecret, _dest, _data, _newSecret, _newFriendsHashes);
}
}

View File

@ -3,12 +3,11 @@ const Embark = require('embark');
let EmbarkSpec = Embark.initTests();
let web3 = EmbarkSpec.web3;
const identityJson = require('../build/contracts/Identity.json');
const updatedIdentityKernelJson = require('../build/contracts/UpdatedIdentityKernel.json');
const identityJson = require('../dist/contracts/Identity.json');
const updatedIdentityKernelJson = require('../dist/contracts/UpdatedIdentityKernel.json');
const TestUtils = require("../utils/testUtils.js")
const idUtils = require("../utils/identityUtils.js")
const web3EthAbi = require("web3-eth-abi");
describe('IdentityFactory', function(accounts) {