(action)
| 48 | } |
| 49 | |
| 50 | async function checkPermissions(action) { |
| 51 | let contractRegistry = await connect(action._parent.options.jsonInterface, action._parent._address); |
| 52 | //NOTE this is a condition to verify if the transaction comes from a module or not. |
| 53 | if (contractRegistry.methods.hasOwnProperty('factory')) { |
| 54 | let moduleAddress = await contractRegistry.methods.factory().call(); |
| 55 | let moduleRegistry = await connect(abis.moduleFactory(), moduleAddress); |
| 56 | let parentModule = await moduleRegistry.methods.getName().call(); |
| 57 | let result = await checkPermission(web3.utils.hexToUtf8(parentModule), action._method.name, contractRegistry); |
| 58 | if (!result) { |
| 59 | console.log("You haven't the right permissions to execute this method."); |
| 60 | process.exit(0); |
| 61 | } |
| 62 | } |
| 63 | return |
| 64 | } |
| 65 | |
| 66 | module.exports = { |
| 67 | convertToDaysRemaining: function (timeRemaining) { |
no test coverage detected