@@ -76,7 +76,6 @@ describe('TransferReservationOwnership', () => {
7676
7777 describe ( 'Types' , ( ) => {
7878 test ( 'should extend procedure and have TransferReservationOwnership type' , async ( ) => {
79- target = new TransferReservationOwnership ( params , contextMock . getMockInstance ( ) ) ;
8079 expect ( target instanceof Procedure ) . toBe ( true ) ;
8180 expect ( target . type ) . toBe ( ProcedureType . TransferReservationOwnership ) ;
8281 } ) ;
@@ -92,14 +91,30 @@ describe('TransferReservationOwnership', () => {
9291 await expect ( target . prepareTransactions ( ) ) . rejects . toThrowError (
9392 new PolymathError ( {
9493 code : ErrorCode . ProcedureValidationError ,
95- message : `You can not transfer a Security Token already launched` ,
94+ message : `The ${
95+ params . symbol
96+ } Security Token has already been launched, ownership cannot be transferred`,
97+ } )
98+ ) ;
99+ } ) ;
100+
101+ test ( 'should throw error if current wallet is not the reservation ticker owner' , async ( ) => {
102+ await expect ( target . prepareTransactions ( ) ) . rejects . toThrowError (
103+ new PolymathError ( {
104+ code : ErrorCode . ProcedureValidationError ,
105+ message : `Only the reservation owner can transfer ownership to another wallet` ,
96106 } )
97107 ) ;
98108 } ) ;
99109
100110 test ( 'should throw error if new owner is equals to the current one' , async ( ) => {
101111 contextMock . set ( 'currentWallet' , new Wallet ( { address : ( ) => Promise . resolve ( '0x01' ) } ) ) ;
102112
113+ target = new TransferReservationOwnership (
114+ { ...params , newOwner : '0x01' } ,
115+ contextMock . getMockInstance ( )
116+ ) ;
117+
103118 await expect ( target . prepareTransactions ( ) ) . rejects . toThrowError (
104119 new PolymathError ( {
105120 code : ErrorCode . ProcedureValidationError ,
@@ -109,6 +124,8 @@ describe('TransferReservationOwnership', () => {
109124 } ) ;
110125
111126 test ( 'should add a transaction to the queue to change the transfer reservation ownership' , async ( ) => {
127+ contextMock . set ( 'currentWallet' , new Wallet ( { address : ( ) => Promise . resolve ( '0x01' ) } ) ) ;
128+
112129 const addTransactionSpy = spy ( target , 'addTransaction' ) ;
113130 securityTokenRegistryMock . mock (
114131 'transferTickerOwnership' ,
0 commit comments