@@ -17,7 +17,7 @@ import {assert, expect} from 'chai';
1717import * as CryptoJS from 'crypto-js' ;
1818import { ChronoUnit } from 'js-joda' ;
1919import { keccak_256 , sha3_256 } from 'js-sha3' ;
20- import { nacl_catapult } from 'nem2-library ' ;
20+ import { Crypto } from '../../src/core/crypto ' ;
2121import { Convert as convert } from '../../src/core/format' ;
2222import { AccountHttp } from '../../src/infrastructure/AccountHttp' ;
2323import { NamespaceHttp } from '../../src/infrastructure/infrastructure' ;
@@ -67,7 +67,6 @@ import {Transaction} from '../../src/model/transaction/Transaction';
6767import { TransactionType } from '../../src/model/transaction/TransactionType' ;
6868import { TransferTransaction } from '../../src/model/transaction/TransferTransaction' ;
6969import { UInt64 } from '../../src/model/UInt64' ;
70-
7170describe ( 'TransactionHttp' , ( ) => {
7271 let transactionHash ;
7372 let transactionId ;
@@ -993,7 +992,7 @@ describe('TransactionHttp', () => {
993992 NetworkCurrencyMosaic . createAbsolute ( 10 ) ,
994993 UInt64 . fromUint ( 100 ) ,
995994 HashType . Op_Sha3_256 ,
996- sha3_256 . create ( ) . update ( nacl_catapult . randomBytes ( 20 ) ) . hex ( ) ,
995+ sha3_256 . create ( ) . update ( Crypto . randomBytes ( 20 ) ) . hex ( ) ,
997996 account2 . address ,
998997 NetworkType . MIJIN_TEST ,
999998 ) ;
@@ -1029,7 +1028,7 @@ describe('TransactionHttp', () => {
10291028 NetworkCurrencyMosaic . createAbsolute ( 10 ) ,
10301029 UInt64 . fromUint ( 100 ) ,
10311030 HashType . Op_Sha3_256 ,
1032- sha3_256 . create ( ) . update ( nacl_catapult . randomBytes ( 20 ) ) . hex ( ) ,
1031+ sha3_256 . create ( ) . update ( Crypto . randomBytes ( 20 ) ) . hex ( ) ,
10331032 account2 . address ,
10341033 NetworkType . MIJIN_TEST ,
10351034 ) ;
@@ -1063,7 +1062,7 @@ describe('TransactionHttp', () => {
10631062 NetworkCurrencyMosaic . createAbsolute ( 10 ) ,
10641063 UInt64 . fromUint ( 100 ) ,
10651064 HashType . Op_Keccak_256 ,
1066- sha3_256 . create ( ) . update ( nacl_catapult . randomBytes ( 20 ) ) . hex ( ) ,
1065+ sha3_256 . create ( ) . update ( Crypto . randomBytes ( 20 ) ) . hex ( ) ,
10671066 account2 . address ,
10681067 NetworkType . MIJIN_TEST ,
10691068 ) ;
@@ -1093,7 +1092,7 @@ describe('TransactionHttp', () => {
10931092 NetworkCurrencyMosaic . createAbsolute ( 10 ) ,
10941093 UInt64 . fromUint ( 100 ) ,
10951094 HashType . Op_Keccak_256 ,
1096- sha3_256 . create ( ) . update ( nacl_catapult . randomBytes ( 20 ) ) . hex ( ) ,
1095+ sha3_256 . create ( ) . update ( Crypto . randomBytes ( 20 ) ) . hex ( ) ,
10971096 account2 . address ,
10981097 NetworkType . MIJIN_TEST ,
10991098 ) ;
@@ -1122,7 +1121,7 @@ describe('TransactionHttp', () => {
11221121 return listener . close ( ) ;
11231122 } ) ;
11241123 it ( 'standalone' , ( done ) => {
1125- const secretSeed = String . fromCharCode . apply ( null , nacl_catapult . randomBytes ( 20 ) ) ;
1124+ const secretSeed = String . fromCharCode . apply ( null , Crypto . randomBytes ( 20 ) ) ;
11261125 const secret = CryptoJS . RIPEMD160 ( CryptoJS . SHA256 ( secretSeed ) . toString ( CryptoJS . enc . Hex ) ) . toString ( CryptoJS . enc . Hex ) ;
11271126 const secretLockTransaction = SecretLockTransaction . create (
11281127 Deadline . create ( ) ,
@@ -1154,7 +1153,7 @@ describe('TransactionHttp', () => {
11541153 return listener . close ( ) ;
11551154 } ) ;
11561155 it ( 'aggregate' , ( done ) => {
1157- const secretSeed = String . fromCharCode . apply ( null , nacl_catapult . randomBytes ( 20 ) ) ;
1156+ const secretSeed = String . fromCharCode . apply ( null , Crypto . randomBytes ( 20 ) ) ;
11581157 const secret = CryptoJS . RIPEMD160 ( CryptoJS . SHA256 ( secretSeed ) . toString ( CryptoJS . enc . Hex ) ) . toString ( CryptoJS . enc . Hex ) ;
11591158 const secretLockTransaction = SecretLockTransaction . create (
11601159 Deadline . create ( ) ,
@@ -1195,7 +1194,7 @@ describe('TransactionHttp', () => {
11951194 NetworkCurrencyMosaic . createAbsolute ( 10 ) ,
11961195 UInt64 . fromUint ( 100 ) ,
11971196 HashType . Op_Hash_256 ,
1198- sha3_256 . create ( ) . update ( nacl_catapult . randomBytes ( 20 ) ) . hex ( ) ,
1197+ sha3_256 . create ( ) . update ( Crypto . randomBytes ( 20 ) ) . hex ( ) ,
11991198 account2 . address ,
12001199 NetworkType . MIJIN_TEST ,
12011200 ) ;
@@ -1225,7 +1224,7 @@ describe('TransactionHttp', () => {
12251224 NetworkCurrencyMosaic . createAbsolute ( 10 ) ,
12261225 UInt64 . fromUint ( 100 ) ,
12271226 HashType . Op_Hash_256 ,
1228- sha3_256 . create ( ) . update ( nacl_catapult . randomBytes ( 20 ) ) . hex ( ) ,
1227+ sha3_256 . create ( ) . update ( Crypto . randomBytes ( 20 ) ) . hex ( ) ,
12291228 account2 . address ,
12301229 NetworkType . MIJIN_TEST ,
12311230 ) ;
@@ -1254,7 +1253,7 @@ describe('TransactionHttp', () => {
12541253 return listener . close ( ) ;
12551254 } ) ;
12561255 it ( 'standalone' , ( done ) => {
1257- const secretSeed = nacl_catapult . randomBytes ( 20 ) ;
1256+ const secretSeed = Crypto . randomBytes ( 20 ) ;
12581257 const secret = sha3_256 . create ( ) . update ( secretSeed ) . hex ( ) ;
12591258 const proof = convert . uint8ToHex ( secretSeed ) ;
12601259
@@ -1305,7 +1304,7 @@ describe('TransactionHttp', () => {
13051304 return listener . close ( ) ;
13061305 } ) ;
13071306 it ( 'aggregate' , ( done ) => {
1308- const secretSeed = nacl_catapult . randomBytes ( 20 ) ;
1307+ const secretSeed = Crypto . randomBytes ( 20 ) ;
13091308 const secret = sha3_256 . create ( ) . update ( secretSeed ) . hex ( ) ;
13101309 const proof = convert . uint8ToHex ( secretSeed ) ;
13111310 const secretLockTransaction = SecretLockTransaction . create (
@@ -1353,7 +1352,7 @@ describe('TransactionHttp', () => {
13531352 return listener . close ( ) ;
13541353 } ) ;
13551354 it ( 'standalone' , ( done ) => {
1356- const secretSeed = nacl_catapult . randomBytes ( 20 ) ;
1355+ const secretSeed = Crypto . randomBytes ( 20 ) ;
13571356 const secret = keccak_256 . create ( ) . update ( secretSeed ) . hex ( ) ;
13581357 const proof = convert . uint8ToHex ( secretSeed ) ;
13591358 const secretLockTransaction = SecretLockTransaction . create (
@@ -1397,7 +1396,7 @@ describe('TransactionHttp', () => {
13971396 return listener . close ( ) ;
13981397 } ) ;
13991398 it ( 'aggregate' , ( done ) => {
1400- const secretSeed = nacl_catapult . randomBytes ( 20 ) ;
1399+ const secretSeed = Crypto . randomBytes ( 20 ) ;
14011400 const secret = keccak_256 . create ( ) . update ( secretSeed ) . hex ( ) ;
14021401 const proof = convert . uint8ToHex ( secretSeed ) ;
14031402 const secretLockTransaction = SecretLockTransaction . create (
0 commit comments