@@ -479,7 +479,7 @@ contract("ModuleRegistry", accounts => {
479479
480480 let sto1 = ( await I_MRProxied . getModulesByType . call ( 3 ) ) [ 0 ] ;
481481 let sto2 = ( await I_MRProxied . getModulesByType . call ( 3 ) ) [ 1 ] ;
482- let sto3 = ( await I_MRProxied . getModulesByType . call ( 3 ) ) [ 2 ] ;
482+ let sto3 = ( await I_MRProxied . getModulesByType . call ( 3 ) ) [ 2 ] ;
483483 let sto4 = ( await I_MRProxied . getModulesByType . call ( 3 ) ) [ 3 ] ;
484484
485485 assert . equal ( sto1 , I_CappedSTOFactory1 . address ) ;
@@ -542,7 +542,7 @@ contract("ModuleRegistry", accounts => {
542542 I_MRProxied . reclaimERC20 ( "0x000000000000000000000000000000000000000" , { from : account_polymath } )
543543 ) ;
544544 } ) ;
545-
545+
546546 it ( "Should successfully reclaim POLY tokens -- not authorised" , async ( ) => {
547547 catchRevert (
548548 I_MRProxied . reclaimERC20 ( I_PolyToken . address , { from : account_temp } )
@@ -592,7 +592,7 @@ contract("ModuleRegistry", accounts => {
592592 I_ReclaimERC20 . reclaimERC20 ( "0x000000000000000000000000000000000000000" , { from : account_polymath } )
593593 ) ;
594594 } ) ;
595-
595+
596596 it ( "Should successfully reclaim POLY tokens -- not authorised" , async ( ) => {
597597 catchRevert (
598598 I_ReclaimERC20 . reclaimERC20 ( I_PolyToken . address , { from : account_temp } )
@@ -614,7 +614,7 @@ contract("ModuleRegistry", accounts => {
614614 describe ( "Test case for the PolymathRegistry" , async ( ) => {
615615
616616 it ( "Should successfully get the address -- fail because key is not exist" , async ( ) => {
617- catchRevert (
617+ catchRevert (
618618 I_PolymathRegistry . getAddress ( "PolyOracle" )
619619 ) ;
620620 } ) ;
@@ -624,6 +624,35 @@ contract("ModuleRegistry", accounts => {
624624 assert . equal ( _moduleR , I_ModuleRegistryProxy . address ) ;
625625 } )
626626 } )
627+
628+
629+ describe ( "Test cases for the transferOwnership" , async ( ) => {
630+
631+ it ( "Should fail to transfer the ownership -- not authorised" , async ( ) => {
632+ catchRevert (
633+ I_MRProxied . transferOwnership ( account_temp , { from : account_issuer } )
634+ ) ;
635+ } ) ;
636+
637+ it ( "Should fail to transfer the ownership -- 0x address is not allowed" , async ( ) => {
638+ catchRevert (
639+ I_MRProxied . transferOwnership ( "0x000000000000000000000000000000000000000" , { from : account_polymath } )
640+ ) ;
641+ } ) ;
642+
643+ it ( "Should successfully transfer the ownership of the STR" , async ( ) => {
644+ let tx = await I_MRProxied . transferOwnership ( account_temp , { from : account_polymath } ) ;
645+ assert . equal ( tx . logs [ 0 ] . args . previousOwner , account_polymath ) ;
646+ assert . equal ( tx . logs [ 0 ] . args . newOwner , account_temp ) ;
647+ } ) ;
648+
649+ it ( "New owner has authorisation" , async ( ) => {
650+ let tx = await I_MRProxied . transferOwnership ( account_polymath , { from : account_temp } ) ;
651+ assert . equal ( tx . logs [ 0 ] . args . previousOwner , account_temp ) ;
652+ assert . equal ( tx . logs [ 0 ] . args . newOwner , account_polymath ) ;
653+ } ) ;
654+
655+ } )
627656 } ) ;
628657 } ) ;
629658} ) ;
0 commit comments