@@ -20,7 +20,7 @@ const BigNumber = require('bignumber.js');
2020const web3 = new Web3 ( new Web3 . providers . HttpProvider ( "http://localhost:8545" ) ) // Hardcoded development port
2121
2222
23- contract ( 'SecurityToken ' , accounts => {
23+ contract ( 'Issuance ' , accounts => {
2424
2525
2626 // Accounts Variable declaration
@@ -181,7 +181,7 @@ contract('SecurityToken', accounts => {
181181
182182 // Step 7: Deploy the STversionProxy contract
183183
184- I_STVersion = await STVersion . new ( I_GeneralTransferManagerFactory . address , I_GeneralPermissionManagerFactory . address , { from : account_polymath } ) ;
184+ I_STVersion = await STVersion . new ( I_GeneralTransferManagerFactory . address , { from : account_polymath } ) ;
185185
186186 assert . notEqual (
187187 I_STVersion . address . valueOf ( ) ,
@@ -246,12 +246,12 @@ contract('SecurityToken', accounts => {
246246 LogAddModule . watch ( function ( error , log ) { resolve ( log ) ; } ) ;
247247 } ) ;
248248
249- // Verify that GeneralPermissionManager module get added successfully or not
250- assert . equal ( log . args . _type . toNumber ( ) , permissionManagerKey ) ;
249+ // Verify that GeneralTransferManager module get added successfully or not
250+ assert . equal ( log . args . _type . toNumber ( ) , transferManagerKey ) ;
251251 assert . equal (
252252 web3 . utils . toAscii ( log . args . _name )
253253 . replace ( / \u0000 / g, '' ) ,
254- "GeneralPermissionManager "
254+ "GeneralTransferManager "
255255 ) ;
256256 LogAddModule . stopWatching ( ) ;
257257 } ) ;
@@ -266,14 +266,6 @@ contract('SecurityToken', accounts => {
266266 "GeneralTransferManager contract was not deployed" ,
267267 ) ;
268268
269- moduleData = await I_SecurityToken . modules ( permissionManagerKey , 0 ) ;
270- I_GeneralPermissionManager = GeneralPermissionManager . at ( moduleData [ 1 ] ) ;
271-
272- assert . notEqual (
273- I_GeneralPermissionManager . address . valueOf ( ) ,
274- "0x0000000000000000000000000000000000000000" ,
275- "GeneralDelegateManager contract was not deployed" ,
276- ) ;
277269 } ) ;
278270
279271 it ( "POLYMATH: Should successfully attach the STO factory with the security token" , async ( ) => {
@@ -293,7 +285,7 @@ contract('SecurityToken', accounts => {
293285 let bytesSTO = web3 . eth . abi . encodeFunctionCall ( functionSignature , [ ( latestTime ( ) + duration . seconds ( 5000 ) ) , ( latestTime ( ) + duration . days ( 30 ) ) , cap , rate , fundRaiseType , I_PolyFaucet . address , account_fundsReceiver ] ) ;
294286
295287 const tx = await I_SecurityToken . addModule ( I_CappedSTOFactory . address , bytesSTO , 0 , 0 , true , { from : account_polymath , gas : 2500000 } ) ;
296-
288+
297289 assert . equal ( tx . logs [ 2 ] . args . _type , stoKey , "CappedSTO doesn't get deployed" ) ;
298290 assert . equal (
299291 web3 . utils . toAscii ( tx . logs [ 2 ] . args . _name )
@@ -319,6 +311,10 @@ contract('SecurityToken', accounts => {
319311 } ) ;
320312
321313 it ( "Should add the delegate with permission" , async ( ) => {
314+ //First attach a permission manager to the token
315+ await I_SecurityToken . addModule ( I_GeneralPermissionManagerFactory . address , "" , 0 , 0 , false , { from : account_polymath } ) ;
316+ let moduleData = await I_SecurityToken . modules ( permissionManagerKey , 0 ) ;
317+ I_GeneralPermissionManager = GeneralPermissionManager . at ( moduleData [ 1 ] ) ;
322318 // Add permission to the deletgate (A regesteration process)
323319 await I_GeneralPermissionManager . addPermission ( account_delegate , delegateDetails , { from : account_polymath } ) ;
324320 // Providing the permission to the delegate
0 commit comments