1515 */
1616
1717import { assert , expect } from 'chai' ;
18- import { Duration } from 'js-joda' ;
1918import { Convert } from '../../src/core/format/Convert' ;
2019import { TransactionRepository } from '../../src/infrastructure/TransactionRepository' ;
2120import { Account } from '../../src/model/account/Account' ;
@@ -60,7 +59,6 @@ describe('TransactionService', () => {
6059 let networkType : NetworkType ;
6160 let transactionService : TransactionService ;
6261 let transactionRepository : TransactionRepository ;
63- const epochAdjustment = Duration . ofSeconds ( 1573430400 ) ;
6462
6563 before ( ( ) => {
6664 return helper . start ( { openListener : true } ) . then ( ( ) => {
@@ -86,7 +84,7 @@ describe('TransactionService', () => {
8684
8785 function buildAggregateTransaction ( ) : AggregateTransaction {
8886 const transferTransaction = TransferTransaction . create (
89- Deadline . create ( epochAdjustment ) ,
87+ Deadline . create ( helper . epochAdjustment ) ,
9088 addressAlias ,
9189 [ NetworkCurrencyLocal . createAbsolute ( 1 ) , new Mosaic ( mosaicAlias , UInt64 . fromUint ( 1 ) ) ] ,
9290 PlainMessage . create ( 'test-message' ) ,
@@ -95,7 +93,7 @@ describe('TransactionService', () => {
9593 ) ;
9694 // Unlink MosaicAlias
9795 const mosaicAliasTransactionUnlink = MosaicAliasTransaction . create (
98- Deadline . create ( epochAdjustment ) ,
96+ Deadline . create ( helper . epochAdjustment ) ,
9997 AliasAction . Unlink ,
10098 mosaicAlias ,
10199 mosaicId ,
@@ -107,7 +105,7 @@ describe('TransactionService', () => {
107105 const nonce = MosaicNonce . createRandom ( ) ;
108106 newMosaicId = MosaicId . createFromNonce ( nonce , account . address ) ;
109107 const mosaicDefinitionTransaction = MosaicDefinitionTransaction . create (
110- Deadline . create ( epochAdjustment ) ,
108+ Deadline . create ( helper . epochAdjustment ) ,
111109 nonce ,
112110 newMosaicId ,
113111 MosaicFlags . create ( true , true , false ) ,
@@ -118,7 +116,7 @@ describe('TransactionService', () => {
118116 ) ;
119117
120118 const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction . create (
121- Deadline . create ( epochAdjustment ) ,
119+ Deadline . create ( helper . epochAdjustment ) ,
122120 newMosaicId ,
123121 MosaicSupplyChangeAction . Increase ,
124122 UInt64 . fromUint ( 200000 ) ,
@@ -128,7 +126,7 @@ describe('TransactionService', () => {
128126
129127 // Link namespace with new MosaicId
130128 const mosaicAliasTransactionRelink = MosaicAliasTransaction . create (
131- Deadline . create ( epochAdjustment ) ,
129+ Deadline . create ( helper . epochAdjustment ) ,
132130 AliasAction . Link ,
133131 mosaicAlias ,
134132 newMosaicId ,
@@ -138,7 +136,7 @@ describe('TransactionService', () => {
138136
139137 // Use new mosaicAlias in metadata
140138 const mosaicMetadataTransaction = MosaicMetadataTransaction . create (
141- Deadline . create ( epochAdjustment ) ,
139+ Deadline . create ( helper . epochAdjustment ) ,
142140 account . address ,
143141 UInt64 . fromUint ( 5 ) ,
144142 mosaicAlias ,
@@ -148,7 +146,7 @@ describe('TransactionService', () => {
148146 helper . maxFee ,
149147 ) ;
150148 return AggregateTransaction . createComplete (
151- Deadline . create ( epochAdjustment ) ,
149+ Deadline . create ( helper . epochAdjustment ) ,
152150 [
153151 transferTransaction . toAggregate ( account . publicAccount ) ,
154152 mosaicAliasTransactionUnlink . toAggregate ( account . publicAccount ) ,
@@ -172,7 +170,7 @@ describe('TransactionService', () => {
172170 it ( 'Announce NamespaceRegistrationTransaction' , ( ) => {
173171 const namespaceName = 'root-test-namespace-' + Math . floor ( Math . random ( ) * 10000 ) ;
174172 const registerNamespaceTransaction = NamespaceRegistrationTransaction . createRootNamespace (
175- Deadline . create ( epochAdjustment ) ,
173+ Deadline . create ( helper . epochAdjustment ) ,
176174 namespaceName ,
177175 UInt64 . fromUint ( 20 ) ,
178176 networkType ,
@@ -189,7 +187,7 @@ describe('TransactionService', () => {
189187 it ( 'Announce NamespaceRegistrationTransaction' , ( ) => {
190188 const namespaceName = 'root-test-namespace-' + Math . floor ( Math . random ( ) * 10000 ) ;
191189 const registerNamespaceTransaction = NamespaceRegistrationTransaction . createRootNamespace (
192- Deadline . create ( epochAdjustment ) ,
190+ Deadline . create ( helper . epochAdjustment ) ,
193191 namespaceName ,
194192 UInt64 . fromUint ( 50 ) ,
195193 networkType ,
@@ -205,7 +203,7 @@ describe('TransactionService', () => {
205203 describe ( 'Setup test AddressAlias' , ( ) => {
206204 it ( 'Announce addressAliasTransaction' , ( ) => {
207205 const addressAliasTransaction = AddressAliasTransaction . create (
208- Deadline . create ( epochAdjustment ) ,
206+ Deadline . create ( helper . epochAdjustment ) ,
209207 AliasAction . Link ,
210208 addressAlias ,
211209 account . address ,
@@ -224,7 +222,7 @@ describe('TransactionService', () => {
224222 const nonce = MosaicNonce . createRandom ( ) ;
225223 mosaicId = MosaicId . createFromNonce ( nonce , account . address ) ;
226224 const mosaicDefinitionTransaction = MosaicDefinitionTransaction . create (
227- Deadline . create ( epochAdjustment ) ,
225+ Deadline . create ( helper . epochAdjustment ) ,
228226 nonce ,
229227 mosaicId ,
230228 MosaicFlags . create ( true , true , false ) ,
@@ -243,7 +241,7 @@ describe('TransactionService', () => {
243241 describe ( 'MosaicSupplyChangeTransaction' , ( ) => {
244242 it ( 'standalone' , ( ) => {
245243 const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction . create (
246- Deadline . create ( epochAdjustment ) ,
244+ Deadline . create ( helper . epochAdjustment ) ,
247245 mosaicId ,
248246 MosaicSupplyChangeAction . Increase ,
249247 UInt64 . fromUint ( 200000 ) ,
@@ -259,7 +257,7 @@ describe('TransactionService', () => {
259257 describe ( 'Setup MosaicAlias' , ( ) => {
260258 it ( 'Announce MosaicAliasTransaction' , ( ) => {
261259 const mosaicAliasTransaction = MosaicAliasTransaction . create (
262- Deadline . create ( epochAdjustment ) ,
260+ Deadline . create ( helper . epochAdjustment ) ,
263261 AliasAction . Link ,
264262 mosaicAlias ,
265263 mosaicId ,
@@ -275,7 +273,7 @@ describe('TransactionService', () => {
275273 describe ( 'Create Transfer with alias' , ( ) => {
276274 it ( 'Announce TransferTransaction' , ( ) => {
277275 const transferTransaction = TransferTransaction . create (
278- Deadline . create ( epochAdjustment ) ,
276+ Deadline . create ( helper . epochAdjustment ) ,
279277 addressAlias ,
280278 [ NetworkCurrencyLocal . createAbsolute ( 1 ) , new Mosaic ( mosaicAlias , UInt64 . fromUint ( 1 ) ) ] ,
281279 PlainMessage . create ( 'test-message' ) ,
@@ -313,7 +311,7 @@ describe('TransactionService', () => {
313311 describe ( 'Transfer mosaic to account 3' , ( ) => {
314312 it ( 'Announce TransferTransaction' , ( ) => {
315313 const transferTransaction = TransferTransaction . create (
316- Deadline . create ( epochAdjustment ) ,
314+ Deadline . create ( helper . epochAdjustment ) ,
317315 account3 . address ,
318316 [ new Mosaic ( mosaicAlias , UInt64 . fromUint ( 1 ) ) ] ,
319317 PlainMessage . create ( 'test-message' ) ,
@@ -331,7 +329,7 @@ describe('TransactionService', () => {
331329 const transactions : SignedTransaction [ ] = [ ] ;
332330 // 1. Transfer A -> B
333331 const transaction1 = TransferTransaction . create (
334- Deadline . create ( epochAdjustment ) ,
332+ Deadline . create ( helper . epochAdjustment ) ,
335333 account2 . address ,
336334 [ new Mosaic ( mosaicAlias , UInt64 . fromUint ( 1 ) ) ] ,
337335 PlainMessage . create ( 'test-message' ) ,
@@ -342,7 +340,7 @@ describe('TransactionService', () => {
342340
343341 // 2. Transfer C -> D
344342 const transaction2 = TransferTransaction . create (
345- Deadline . create ( epochAdjustment ) ,
343+ Deadline . create ( helper . epochAdjustment ) ,
346344 cosignAccount4 . address ,
347345 [ new Mosaic ( mosaicAlias , UInt64 . fromUint ( 1 ) ) ] ,
348346 PlainMessage . create ( 'test-message' ) ,
0 commit comments