@@ -479,7 +479,7 @@ contract("ModuleRegistry", accounts => {
479
479
480
480
let sto1 = ( await I_MRProxied . getModulesByType . call ( 3 ) ) [ 0 ] ;
481
481
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 ] ;
483
483
let sto4 = ( await I_MRProxied . getModulesByType . call ( 3 ) ) [ 3 ] ;
484
484
485
485
assert . equal ( sto1 , I_CappedSTOFactory1 . address ) ;
@@ -542,7 +542,7 @@ contract("ModuleRegistry", accounts => {
542
542
I_MRProxied . reclaimERC20 ( "0x000000000000000000000000000000000000000" , { from : account_polymath } )
543
543
) ;
544
544
} ) ;
545
-
545
+
546
546
it ( "Should successfully reclaim POLY tokens -- not authorised" , async ( ) => {
547
547
catchRevert (
548
548
I_MRProxied . reclaimERC20 ( I_PolyToken . address , { from : account_temp } )
@@ -592,7 +592,7 @@ contract("ModuleRegistry", accounts => {
592
592
I_ReclaimERC20 . reclaimERC20 ( "0x000000000000000000000000000000000000000" , { from : account_polymath } )
593
593
) ;
594
594
} ) ;
595
-
595
+
596
596
it ( "Should successfully reclaim POLY tokens -- not authorised" , async ( ) => {
597
597
catchRevert (
598
598
I_ReclaimERC20 . reclaimERC20 ( I_PolyToken . address , { from : account_temp } )
@@ -614,7 +614,7 @@ contract("ModuleRegistry", accounts => {
614
614
describe ( "Test case for the PolymathRegistry" , async ( ) => {
615
615
616
616
it ( "Should successfully get the address -- fail because key is not exist" , async ( ) => {
617
- catchRevert (
617
+ catchRevert (
618
618
I_PolymathRegistry . getAddress ( "PolyOracle" )
619
619
) ;
620
620
} ) ;
@@ -624,6 +624,35 @@ contract("ModuleRegistry", accounts => {
624
624
assert . equal ( _moduleR , I_ModuleRegistryProxy . address ) ;
625
625
} )
626
626
} )
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
+ } )
627
656
} ) ;
628
657
} ) ;
629
658
} ) ;
0 commit comments