@@ -43,6 +43,7 @@ import { NetworkHttp } from '../../src/infrastructure/NetworkHttp';
4343import { NodeHttp } from '../../src/infrastructure/NodeHttp' ;
4444import { NetworkType } from '../../src/model/network/NetworkType' ;
4545import { deepEqual } from 'assert' ;
46+ import * as testResources from '../resource/TestResources' ;
4647
4748describe ( 'NetworkHttp' , ( ) => {
4849 const url = 'http://someHost' ;
@@ -121,105 +122,11 @@ describe('NetworkHttp', () => {
121122 } ) ;
122123
123124 it ( 'getNetworkProperties' , async ( ) => {
124-
125- const body = new NetworkConfigurationDTO ( ) ;
126-
127- const network = new NetworkPropertiesDTO ( ) ;
128- network . identifier = 'id' ;
129- network . nodeEqualityStrategy = NodeIdentityEqualityStrategy . Host ;
130- network . publicKey = 'pubKey' ;
131- network . generationHash = 'genHash' ;
132- network . epochAdjustment = '123456' ;
133-
134- const chain = new ChainPropertiesDTO ( ) ;
135- chain . blockGenerationTargetTime = '1' ;
136- chain . blockPruneInterval = '1' ;
137- chain . blockTimeSmoothingFactor = '1' ;
138- chain . currencyMosaicId = '1111111111111111' ;
139- chain . defaultDynamicFeeMultiplier = '1' ;
140- chain . enableVerifiableReceipts = true ;
141- chain . enableVerifiableState = true ;
142- chain . harvestBeneficiaryPercentage = '1' ;
143- chain . harvestingMosaicId = '2222222222222222' ;
144- chain . importanceActivityPercentage = '1' ;
145- chain . importanceGrouping = '1' ;
146- chain . initialCurrencyAtomicUnits = '1' ;
147- chain . maxBlockFutureTime = '1' ;
148- chain . maxDifficultyBlocks = '1' ;
149- chain . maxHarvesterBalance = '1' ;
150- chain . maxMosaicAtomicUnits = '1' ;
151- chain . maxRollbackBlocks = '1' ;
152- chain . maxTransactionLifetime = '1' ;
153- chain . maxTransactionsPerBlock = '1' ;
154- chain . minHarvesterBalance = '1' ;
155- chain . totalChainImportance = '1' ;
156-
157- const plugin = new PluginsPropertiesDTO ( ) ;
158- plugin . accountlink = new AccountLinkNetworkPropertiesDTO ( ) ;
159- plugin . accountlink . dummy = 'dummy' ;
160-
161- plugin . aggregate = new AggregateNetworkPropertiesDTO ( ) ;
162- plugin . aggregate . enableBondedAggregateSupport = true ;
163- plugin . aggregate . enableStrictCosignatureCheck = true ;
164- plugin . aggregate . maxBondedTransactionLifetime = '1' ;
165- plugin . aggregate . maxCosignaturesPerAggregate = '1' ;
166- plugin . aggregate . maxTransactionsPerAggregate = '1' ;
167-
168- plugin . lockhash = new HashLockNetworkPropertiesDTO ( ) ;
169- plugin . lockhash . lockedFundsPerAggregate = '1' ;
170- plugin . lockhash . maxHashLockDuration = '1' ;
171-
172- plugin . locksecret = new SecretLockNetworkPropertiesDTO ( ) ;
173- plugin . locksecret . maxProofSize = '1' ;
174- plugin . locksecret . maxSecretLockDuration = '1' ;
175- plugin . locksecret . minProofSize = '1' ;
176-
177- plugin . metadata = new MetadataNetworkPropertiesDTO ( ) ;
178- plugin . metadata . maxValueSize = '1' ;
179-
180- plugin . mosaic = new MosaicNetworkPropertiesDTO ( ) ;
181- plugin . mosaic . maxMosaicDivisibility = '1' ;
182- plugin . mosaic . maxMosaicDuration = '1' ;
183- plugin . mosaic . maxMosaicsPerAccount = '1' ;
184- plugin . mosaic . mosaicRentalFee = '1' ;
185- plugin . mosaic . mosaicRentalFeeSinkPublicKey = '1' ;
186-
187- plugin . multisig = new MultisigNetworkPropertiesDTO ( ) ;
188- plugin . multisig . maxCosignatoriesPerAccount = '1' ;
189- plugin . multisig . maxCosignedAccountsPerAccount = '1' ;
190- plugin . multisig . maxMultisigDepth = '1' ;
191-
192- plugin . namespace = new NamespaceNetworkPropertiesDTO ( ) ;
193- plugin . namespace . childNamespaceRentalFee = '1' ;
194- plugin . namespace . maxChildNamespaces = '1' ;
195- plugin . namespace . maxNameSize = '1' ;
196- plugin . namespace . maxNamespaceDepth = '1' ;
197- plugin . namespace . maxNamespaceDuration = '1' ;
198- plugin . namespace . minNamespaceDuration = '1' ;
199- plugin . namespace . namespaceGracePeriodDuration = '1' ;
200- plugin . namespace . namespaceRentalFeeSinkPublicKey = '1' ;
201- plugin . namespace . reservedRootNamespaceNames = '1' ;
202- plugin . namespace . rootNamespaceRentalFeePerBlock = '1' ;
203-
204- plugin . restrictionaccount = new AccountRestrictionNetworkPropertiesDTO ( ) ;
205- plugin . restrictionaccount . maxAccountRestrictionValues = '1' ;
206-
207- plugin . restrictionmosaic = new MosaicRestrictionNetworkPropertiesDTO ( ) ;
208- plugin . restrictionmosaic . maxMosaicRestrictionValues = '1' ;
209-
210- plugin . transfer = new TransferNetworkPropertiesDTO ( ) ;
211- plugin . transfer . maxMessageSize = '1' ;
212-
213- body . chain = chain ;
214- body . network = network ;
215- body . plugins = plugin ;
216-
125+ const body = testResources . getDummyNetworkProperties ( ) ;
217126 when ( networkRoutesApi . getNetworkProperties ( ) ) . thenReturn ( Promise . resolve ( { response, body} ) ) ;
218-
219127 const networkProperties = await networkRepository . getNetworkProperties ( ) . toPromise ( ) ;
220128 deepEqual ( networkProperties . network , body . network ) ;
221129 deepEqual ( networkProperties . chain , body . chain ) ;
222130 deepEqual ( networkProperties . plugins , body . plugins ) ;
223131 } ) ;
224-
225132} ) ;
0 commit comments