@@ -122,6 +122,108 @@ describe('NetworkHttp', () => {
122122 } ) ;
123123
124124 it ( 'getNetworkProperties' , async ( ) => {
125+
126+ const body = new NetworkConfigurationDTO ( ) ;
127+
128+ const network = new NetworkPropertiesDTO ( ) ;
129+ network . identifier = 'id' ;
130+ network . nodeEqualityStrategy = NodeIdentityEqualityStrategy . Host ;
131+ network . publicKey = 'pubKey' ;
132+ network . generationHash = 'genHash' ;
133+ network . epochAdjustment = '123456' ;
134+
135+ const chain = new ChainPropertiesDTO ( ) ;
136+ chain . blockGenerationTargetTime = '1' ;
137+ chain . blockPruneInterval = '1' ;
138+ chain . blockTimeSmoothingFactor = '1' ;
139+ chain . currencyMosaicId = '1111111111111111' ;
140+ chain . defaultDynamicFeeMultiplier = '1' ;
141+ chain . enableVerifiableReceipts = true ;
142+ chain . enableVerifiableState = true ;
143+ chain . harvestBeneficiaryPercentage = '1' ;
144+ chain . harvestingMosaicId = '2222222222222222' ;
145+ chain . importanceActivityPercentage = '1' ;
146+ chain . importanceGrouping = '1' ;
147+ chain . initialCurrencyAtomicUnits = '1' ;
148+ chain . maxBlockFutureTime = '1' ;
149+ chain . maxDifficultyBlocks = '1' ;
150+ chain . maxHarvesterBalance = '1' ;
151+ chain . maxMosaicAtomicUnits = '1' ;
152+ chain . maxRollbackBlocks = '1' ;
153+ chain . maxTransactionLifetime = '1' ;
154+ chain . maxTransactionsPerBlock = '1' ;
155+ chain . minHarvesterBalance = '1' ;
156+ chain . totalChainImportance = '1' ;
157+
158+ const plugin = new PluginsPropertiesDTO ( ) ;
159+ plugin . accountlink = new AccountLinkNetworkPropertiesDTO ( ) ;
160+ plugin . accountlink . dummy = 'dummy' ;
161+
162+ plugin . aggregate = new AggregateNetworkPropertiesDTO ( ) ;
163+ plugin . aggregate . enableBondedAggregateSupport = true ;
164+ plugin . aggregate . enableStrictCosignatureCheck = true ;
165+ plugin . aggregate . maxBondedTransactionLifetime = '1' ;
166+ plugin . aggregate . maxCosignaturesPerAggregate = '1' ;
167+ plugin . aggregate . maxTransactionsPerAggregate = '1' ;
168+
169+ plugin . lockhash = new HashLockNetworkPropertiesDTO ( ) ;
170+ plugin . lockhash . lockedFundsPerAggregate = '1' ;
171+ plugin . lockhash . maxHashLockDuration = '1' ;
172+
173+ plugin . locksecret = new SecretLockNetworkPropertiesDTO ( ) ;
174+ plugin . locksecret . maxProofSize = '1' ;
175+ plugin . locksecret . maxSecretLockDuration = '1' ;
176+ plugin . locksecret . minProofSize = '1' ;
177+
178+ plugin . metadata = new MetadataNetworkPropertiesDTO ( ) ;
179+ plugin . metadata . maxValueSize = '1' ;
180+
181+ plugin . mosaic = new MosaicNetworkPropertiesDTO ( ) ;
182+ plugin . mosaic . maxMosaicDivisibility = '1' ;
183+ plugin . mosaic . maxMosaicDuration = '1' ;
184+ plugin . mosaic . maxMosaicsPerAccount = '1' ;
185+ plugin . mosaic . mosaicRentalFee = '1' ;
186+ plugin . mosaic . mosaicRentalFeeSinkPublicKey = '1' ;
187+
188+ plugin . multisig = new MultisigNetworkPropertiesDTO ( ) ;
189+ plugin . multisig . maxCosignatoriesPerAccount = '1' ;
190+ plugin . multisig . maxCosignedAccountsPerAccount = '1' ;
191+ plugin . multisig . maxMultisigDepth = '1' ;
192+
193+ plugin . namespace = new NamespaceNetworkPropertiesDTO ( ) ;
194+ plugin . namespace . childNamespaceRentalFee = '1' ;
195+ plugin . namespace . maxChildNamespaces = '1' ;
196+ plugin . namespace . maxNameSize = '1' ;
197+ plugin . namespace . maxNamespaceDepth = '1' ;
198+ plugin . namespace . maxNamespaceDuration = '1' ;
199+ plugin . namespace . minNamespaceDuration = '1' ;
200+ plugin . namespace . namespaceGracePeriodDuration = '1' ;
201+ plugin . namespace . namespaceRentalFeeSinkPublicKey = '1' ;
202+ plugin . namespace . reservedRootNamespaceNames = '1' ;
203+ plugin . namespace . rootNamespaceRentalFeePerBlock = '1' ;
204+
205+ plugin . restrictionaccount = new AccountRestrictionNetworkPropertiesDTO ( ) ;
206+ plugin . restrictionaccount . maxAccountRestrictionValues = '1' ;
207+
208+ plugin . restrictionmosaic = new MosaicRestrictionNetworkPropertiesDTO ( ) ;
209+ plugin . restrictionmosaic . maxMosaicRestrictionValues = '1' ;
210+
211+ plugin . transfer = new TransferNetworkPropertiesDTO ( ) ;
212+ plugin . transfer . maxMessageSize = '1' ;
213+
214+ body . chain = chain ;
215+ body . network = network ;
216+ body . plugins = plugin ;
217+
218+ when ( networkRoutesApi . getNetworkProperties ( ) ) . thenReturn ( Promise . resolve ( { response, body} ) ) ;
219+
220+ const networkProperties = await networkRepository . getNetworkProperties ( ) . toPromise ( ) ;
221+ deepEqual ( networkProperties . network , body . network ) ;
222+ deepEqual ( networkProperties . chain , body . chain ) ;
223+ deepEqual ( networkProperties . plugins , body . plugins ) ;
224+ } ) ;
225+
226+ it ( 'getNetworkProperties - using rest json payload' , async ( ) => {
125227 const body = testResources . getDummyNetworkProperties ( ) ;
126228 when ( networkRoutesApi . getNetworkProperties ( ) ) . thenReturn ( Promise . resolve ( { response, body} ) ) ;
127229 const networkProperties = await networkRepository . getNetworkProperties ( ) . toPromise ( ) ;
0 commit comments