1- import { encodeCallScript , getRoleHash , logger } from '@utils' ;
1+ import { getRoleHash , logger } from '@utils' ;
22import { confirmRoleGranting , printRoles } from './roles-auxiliary' ;
33import { Contract } from 'ethers' ;
44import { aclContract } from '@contracts' ;
5+ import { encodeFromAgent } from '@scripts' ;
56
6- export const encodeFromVotingGrantRolesAragonWithConfirm = async (
7+ export const encodeFromAgentGrantRolesAragonWithConfirm = async (
78 contractName : string ,
89 rolesToGrant : string [ ] ,
910 contract : Contract ,
@@ -13,27 +14,27 @@ export const encodeFromVotingGrantRolesAragonWithConfirm = async (
1314
1415 if ( await confirmRoleGranting ( ) ) {
1516 logger . log ( ) ;
16- return await encodeFromVotingGrantRolesAragon ( contractName , rolesToGrant , contract , rolesBeneficiary ) ;
17+ return await encodeFromAgentGrantRolesAragon ( contractName , rolesToGrant , contract , rolesBeneficiary ) ;
1718 }
1819
1920 return [ ] ;
2021} ;
2122
22- export const encodeFromVotingGrantRolesAragon = async (
23+ export const encodeFromAgentGrantRolesAragon = async (
2324 contractName : string ,
2425 rolesToGrant : string [ ] ,
2526 contract : Contract ,
2627 rolesBeneficiary : string ,
2728) => {
2829 return await Promise . all (
2930 rolesToGrant . map ( async ( role ) => {
30- const [ , grantRoleCall ] = await encodeFromVotingGrantRoleAragon ( contractName , contract , role , rolesBeneficiary ) ;
31+ const [ , grantRoleCall ] = await encodeFromAgentGrantRoleAragon ( contractName , contract , role , rolesBeneficiary ) ;
3132 return grantRoleCall ;
3233 } ) ,
3334 ) ;
3435} ;
3536
36- export const encodeFromVotingGrantRoleAragon = async (
37+ export const encodeFromAgentGrantRoleAragon = async (
3738 contractName : string ,
3839 contract : Contract ,
3940 role : string ,
@@ -49,6 +50,5 @@ export const encodeFromVotingGrantRoleAragon = async (
4950 desc : `${ contractName } : Grant '${ role } ' role to ${ account } ` ,
5051 } ;
5152
52- const encoded = encodeCallScript ( [ grantPermissionCall ] ) ;
53- return [ encoded , grantPermissionCall ] as const ;
53+ return encodeFromAgent ( grantPermissionCall ) ;
5454} ;
0 commit comments