Skip to content

Commit

Permalink
Merge pull request #176 from PascalPrecht/fix/commands/apm/grant
Browse files Browse the repository at this point in the history
fix(commands/apm/grant): use updated CREATE_VERSION_ROLE hash
  • Loading branch information
izqui authored Aug 21, 2018
2 parents 2d261a4 + b9f5a85 commit 02f0cfd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/acl/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ module.exports = (web3) => {
return new web3.eth.Contract(require('@aragon/os/build/contracts/ACL').abi, aclAddr)
}

const getRoleId = async (repoAddr) => {
const repo = new web3.eth.Contract(require('@aragon/os/build/contracts/Repo').abi, repoAddr)
return await repo.methods.CREATE_VERSION_ROLE().call()
}

return {
grant: async (repoAddr, grantee) => {
const acl = await getACL(repoAddr)

const roleId = '0x0000000000000000000000000000000000000000000000000000000000000001'
const roleId = await getRoleId(repoAddr)

const call = acl.methods.grantPermission(grantee, repoAddr, roleId)
return {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/apm_cmds/grant.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ exports.handler = async function ({
network,
module,
apm: apmOptions,

// Arguments
address
}) {

const web3 = await ensureWeb3(network)
apmOptions.ensRegistryAddress = apmOptions['ens-registry']

Expand Down
2 changes: 1 addition & 1 deletion src/commands/apm_cmds/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports.describe = 'Publish a new version of the application'
exports.builder = function (yargs) {
return deploy.builder(yargs) // inherit deploy options
.positional('contract', {
description: 'The address or name of the contract to publish in this version. If it isn\' provided, it will default to the current version\'s contract.'
description: 'The address or name of the contract to publish in this version. If it isn\'t provided, it will default to the current version\'s contract.'
}).option('only-artifacts', {
description: 'Whether just generate artifacts file without publishing',
default: false,
Expand Down

0 comments on commit 02f0cfd

Please sign in to comment.