@@ -88,30 +88,24 @@ describe('BlockService', () => {
8888 */
8989
9090 describe ( 'Validate transansaction' , ( ) => {
91- it ( 'call block service' , ( ) => {
92- return transactionRepository . getTransaction ( transactionHash ) . subscribe (
93- ( transaction ) => {
94- const transactionInfo = transaction . transactionInfo ;
95- if ( transactionInfo && transactionInfo . height !== undefined ) {
96- const validationResult = blockService . validateTransactionInBlock ( transactionHash , transactionInfo . height ) ;
97- expect ( validationResult ) . to . be . true ;
98- }
99- assert ( false , `Transaction (hash: ${ transactionHash } ) not found` ) ;
100- } ,
101- ) ;
91+ it ( 'call block service' , async ( ) => {
92+ const transaction = await transactionRepository . getTransaction ( transactionHash ) . toPromise ( ) ;
93+ const transactionInfo = transaction . transactionInfo ;
94+ if ( transactionInfo && transactionInfo . height !== undefined ) {
95+ const validationResult = await blockService . validateTransactionInBlock ( transactionHash , transactionInfo . height ) . toPromise ( ) ;
96+ expect ( validationResult ) . to . be . true ;
97+ } else {
98+ assert ( false , `Transaction (hash: ${ transactionHash } ) not found` ) ;
99+ }
102100 } ) ;
103101 } ) ;
104102
105103 describe ( 'Validate receipt' , ( ) => {
106- it ( 'call block service' , ( ) => {
107- return receiptRepository . getBlockReceipts ( UInt64 . fromUint ( 1 ) ) . subscribe (
108- ( statement ) => {
109- const receipt = statement . transactionStatements [ 0 ] ;
110- const validationResult = blockService . validateReceiptInBlock ( receipt . generateHash ( ) , UInt64 . fromUint ( 1 ) ) ;
111- expect ( validationResult ) . to . be . true ;
112- } ,
113- ) ;
104+ it ( 'call block service' , async ( ) => {
105+ const statement = await receiptRepository . getBlockReceipts ( UInt64 . fromUint ( 1 ) ) . toPromise ( ) ;
106+ const receipt = statement . transactionStatements [ 0 ] ;
107+ const validationResult = await blockService . validateReceiptInBlock ( receipt . generateHash ( ) , UInt64 . fromUint ( 1 ) ) . toPromise ( ) ;
108+ expect ( validationResult ) . to . be . true ;
114109 } ) ;
115110 } ) ;
116-
117111} ) ;
0 commit comments