Updated test unit to reflect changes in recovery contract
This commit is contained in:
parent
7695b461fb
commit
c9711c2250
|
@ -8,4 +8,27 @@ 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)
|
||||
external
|
||||
pure
|
||||
returns(bytes32)
|
||||
{
|
||||
return keccak256(identity, _revealedSecret, _dest, _data, _newSecret, _newFriendsHashes);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -103,6 +103,21 @@ const _setupRecovery = function(address){
|
|||
}, [address]);
|
||||
}
|
||||
|
||||
const _managerReset = function(address){
|
||||
if(!/^(0x)?[0-9a-f]{0,40}$/i.test(address))
|
||||
throw new Error('Address "'+ address +'" is not a valid Ethereum address.');
|
||||
|
||||
return web3EthAbi.encodeFunctionCall({
|
||||
name: 'managerReset',
|
||||
type: 'function',
|
||||
inputs: [{
|
||||
type: 'address',
|
||||
name: '_newKey'
|
||||
}]
|
||||
}, [address]);
|
||||
}
|
||||
|
||||
|
||||
const _updateUpdatableInstance = function(address){
|
||||
if(!/^(0x)?[0-9a-f]{0,40}$/i.test(address))
|
||||
throw new Error('Address "'+ address +'" is not a valid Ethereum address.');
|
||||
|
@ -167,6 +182,7 @@ module.exports = {
|
|||
removeKey: _removeKey,
|
||||
setMinimumApprovalsByKeyType: _setMinimumApprovalsByKeyType,
|
||||
setupRecovery: _setupRecovery,
|
||||
managerReset: _managerReset,
|
||||
updateUpdatableInstance: _updateUpdatableInstance,
|
||||
updateRequestUpdatableInstance: _updateRequestUpdatableInstance,
|
||||
updateConfirmUpdatableInstance: _updateConfirmUpdatableInstance,
|
||||
|
|
Loading…
Reference in New Issue