@@ -76,9 +76,10 @@ import { MosaicRestrictionFlag } from '../../src/model/restriction/MosaicRestric
7676import { OperationRestrictionFlag } from '../../src/model/restriction/OperationRestrictionFlag' ;
7777import { TransactionGroup } from '../../src/infrastructure/TransactionGroup' ;
7878import { TransactionStatusRepository } from '../../src/infrastructure/TransactionStatusRepository' ;
79-
80- // eslint-disable-next-line @typescript-eslint/no-var-requires
81- const CryptoJS = require ( 'crypto-js' ) ;
79+ import * as ripemd160 from 'ripemd160' ;
80+ import { sha256 } from 'js-sha256' ;
81+ import * as secureRandom from 'secure-random' ;
82+ import * as CryptoJS from 'crypto-js' ;
8283
8384describe ( 'TransactionHttp' , ( ) => {
8485 let transactionHash : string ;
@@ -101,12 +102,6 @@ describe('TransactionHttp', () => {
101102 let transactionRepository : TransactionRepository ;
102103 let transactionStatusRepository : TransactionStatusRepository ;
103104 let votingKey : string ;
104- // eslint-disable-next-line @typescript-eslint/no-var-requires
105- const secureRandom = require ( 'secure-random' ) ;
106- // eslint-disable-next-line @typescript-eslint/no-var-requires
107- const sha256 = require ( 'js-sha256' ) ;
108- // eslint-disable-next-line @typescript-eslint/no-var-requires
109- const ripemd160 = require ( 'ripemd160' ) ;
110105
111106 const remoteAccount = Account . generateNewAccount ( helper . networkType ) ;
112107
@@ -737,6 +732,8 @@ describe('TransactionHttp', () => {
737732 const votingLinkTransaction = VotingKeyLinkTransaction . create (
738733 Deadline . create ( ) ,
739734 votingKey ,
735+ UInt64 . fromUint ( 100 ) ,
736+ UInt64 . fromUint ( 300 ) ,
740737 LinkAction . Link ,
741738 networkType ,
742739 helper . maxFee ,
@@ -745,6 +742,8 @@ describe('TransactionHttp', () => {
745742
746743 return helper . announce ( signedTransaction ) . then ( ( transaction : VotingKeyLinkTransaction ) => {
747744 expect ( transaction . linkedPublicKey , 'LinkedPublicKey' ) . not . to . be . undefined ;
745+ expect ( transaction . startPoint , 'StartPoint' ) . not . to . be . undefined ;
746+ expect ( transaction . endPoint , 'EndPoint' ) . not . to . be . undefined ;
748747 expect ( transaction . linkAction , 'LinkAction' ) . not . to . be . undefined ;
749748 return signedTransaction ;
750749 } ) ;
@@ -755,6 +754,8 @@ describe('TransactionHttp', () => {
755754 const votingLinkTransaction = VotingKeyLinkTransaction . create (
756755 Deadline . create ( ) ,
757756 votingKey ,
757+ UInt64 . fromUint ( 100 ) ,
758+ UInt64 . fromUint ( 300 ) ,
758759 LinkAction . Unlink ,
759760 networkType ,
760761 helper . maxFee ,
@@ -1402,13 +1403,13 @@ describe('TransactionHttp', () => {
14021403
14031404 describe ( 'getTransactionsById' , ( ) => {
14041405 it ( 'should return transaction info given array of transactionHash' , async ( ) => {
1405- const transactions = await transactionRepository . getTransactionsById ( [ transactionHash ] ) . toPromise ( ) ;
1406+ const transactions = await transactionRepository . getTransactionsById ( [ transactionHash ] , TransactionGroup . Confirmed ) . toPromise ( ) ;
14061407 expect ( transactions [ 0 ] . transactionInfo ! . hash ) . to . be . equal ( transactionHash ) ;
14071408 expect ( transactions [ 0 ] . transactionInfo ! . id ) . to . be . equal ( transactionId ) ;
14081409 } ) ;
14091410
14101411 it ( 'should return transaction info given array of transactionId' , async ( ) => {
1411- const transactions = await transactionRepository . getTransactionsById ( [ transactionId ] ) . toPromise ( ) ;
1412+ const transactions = await transactionRepository . getTransactionsById ( [ transactionId ] , TransactionGroup . Confirmed ) . toPromise ( ) ;
14121413 expect ( transactions [ 0 ] . transactionInfo ! . hash ) . to . be . equal ( transactionHash ) ;
14131414 expect ( transactions [ 0 ] . transactionInfo ! . id ) . to . be . equal ( transactionId ) ;
14141415 } ) ;
@@ -1468,15 +1469,15 @@ describe('TransactionHttp', () => {
14681469 ) ;
14691470 const signedTransaction = aggregateTransaction . signWith ( cosignAccount1 , generationHash ) ;
14701471 const transactionAnnounceResponse = await transactionRepository . announceAggregateBonded ( signedTransaction ) . toPromise ( ) ;
1471- expect ( transactionAnnounceResponse . message ) . to . be . equal ( 'packet 500 was pushed to the network via /transactions/partial' ) ;
1472+ expect ( transactionAnnounceResponse . message ) . to . be . equal ( 'packet 256 was pushed to the network via /transactions/partial' ) ;
14721473 } ) ;
14731474 } ) ;
14741475
14751476 describe ( 'announceAggregateBondedCosignature' , ( ) => {
14761477 it ( 'should return success when announceAggregateBondedCosignature' , async ( ) => {
14771478 const payload = new CosignatureSignedTransaction ( '' , '' , '' ) ;
14781479 const transactionAnnounceResponse = await transactionRepository . announceAggregateBondedCosignature ( payload ) . toPromise ( ) ;
1479- expect ( transactionAnnounceResponse . message ) . to . be . equal ( 'packet 501 was pushed to the network via /transactions/cosignature' ) ;
1480+ expect ( transactionAnnounceResponse . message ) . to . be . equal ( 'packet 257 was pushed to the network via /transactions/cosignature' ) ;
14801481 } ) ;
14811482 } ) ;
14821483
0 commit comments