@@ -90,7 +90,7 @@ describe('HashLockHttp', () => {
9090 signedAggregatedTransaction : SignedTransaction ,
9191 signer : Account ,
9292 mosaicId : UnresolvedMosaicId ,
93- ) : void => {
93+ ) : any => {
9494 const lockFundsTransaction = LockFundsTransaction . create (
9595 Deadline . create ( ) ,
9696 new Mosaic ( mosaicId , UInt64 . fromUint ( 10 * Math . pow ( 10 , helper . networkCurrencyDivisibility ) ) ) ,
@@ -100,8 +100,7 @@ describe('HashLockHttp', () => {
100100 helper . maxFee ,
101101 ) ;
102102 const signedLockFundsTransaction = signer . sign ( lockFundsTransaction , generationHash ) ;
103- hash = signedLockFundsTransaction . hash ;
104- helper . announce ( signedLockFundsTransaction ) ;
103+ return helper . announce ( signedLockFundsTransaction ) ;
105104 } ;
106105
107106 /**
@@ -152,17 +151,11 @@ describe('HashLockHttp', () => {
152151 * =========================
153152 */
154153
155- describe ( 'getHashLock' , ( ) => {
156- it ( 'should return hash lock info given hash' , async ( ) => {
157- const info = await hashLockRepo . getHashLock ( hash ) . toPromise ( ) ;
158- expect ( info . ownerAddress . plain ( ) ) . to . be . equal ( account . address . plain ( ) ) ;
159- expect ( info . amount . toString ( ) ) . to . be . equal ( '1000' ) ;
160- } ) ;
161- } ) ;
162-
163154 describe ( 'searchHashLock' , ( ) => {
164155 it ( 'should return hash lock page info' , async ( ) => {
156+ await new Promise ( ( resolve ) => setTimeout ( resolve , 3000 ) ) ;
165157 const info = await hashLockRepo . search ( { address : account . address } ) . toPromise ( ) ;
158+ hash = info . data [ 0 ] . hash ;
166159 expect ( info . data . length ) . to . be . greaterThan ( 0 ) ;
167160 } ) ;
168161 } ) ;
@@ -180,6 +173,14 @@ describe('HashLockHttp', () => {
180173 } ) ;
181174 } ) ;
182175
176+ describe ( 'getHashLock' , ( ) => {
177+ it ( 'should return hash lock info given hash' , async ( ) => {
178+ const info = await hashLockRepo . getHashLock ( hash ) . toPromise ( ) ;
179+ expect ( info . ownerAddress . plain ( ) ) . to . be . equal ( account . address . plain ( ) ) ;
180+ expect ( info . amount . toString ( ) ) . to . be . equal ( '10000000' ) ;
181+ } ) ;
182+ } ) ;
183+
183184 /**
184185 * =========================
185186 * House Keeping
0 commit comments