@@ -101,14 +101,15 @@ export class RestrictionHttp extends Http implements RestrictionRepository {
101101 map ( ( response : { response : ClientResponse ; body : MosaicAddressRestrictionDTO ; } ) => {
102102 const payload = response . body . mosaicRestrictionEntry ;
103103 const restirctionItems = new Map < string , string > ( ) ;
104+ payload . restrictions . forEach ( ( restriction ) => {
105+ restirctionItems . set ( restriction . key , restriction . value ) ;
106+ } ) ;
104107 return new MosaicAddressRestriction (
105108 payload . compositeHash ,
106109 payload . entryType ,
107110 new MosaicId ( payload . mosaicId ) ,
108111 Address . createFromEncoded ( payload . targetAddress ) ,
109- payload . restrictions . map ( ( restriction ) => {
110- return restirctionItems . set ( restriction . key , restriction . value ) ;
111- } ) ,
112+ restirctionItems ,
112113 ) ;
113114 } ) ,
114115 catchError ( ( error ) => throwError ( error ) ) ,
@@ -132,14 +133,15 @@ export class RestrictionHttp extends Http implements RestrictionRepository {
132133 const mosaicAddressRestrictionsDTO = response . body ;
133134 return mosaicAddressRestrictionsDTO . map ( ( payload ) => {
134135 const restirctionItems = new Map < string , string > ( ) ;
136+ payload . mosaicRestrictionEntry . restrictions . forEach ( ( restriction ) => {
137+ restirctionItems . set ( restriction . key , restriction . value ) ;
138+ } ) ;
135139 return new MosaicAddressRestriction (
136140 payload . mosaicRestrictionEntry . compositeHash ,
137141 payload . mosaicRestrictionEntry . entryType ,
138142 new MosaicId ( payload . mosaicRestrictionEntry . mosaicId ) ,
139143 Address . createFromEncoded ( payload . mosaicRestrictionEntry . targetAddress ) ,
140- payload . mosaicRestrictionEntry . restrictions . map ( ( restriction ) => {
141- return restirctionItems . set ( restriction . key , restriction . value ) ;
142- } ) ,
144+ restirctionItems ,
143145 ) ;
144146 } ) ;
145147 } ) ,
@@ -159,18 +161,18 @@ export class RestrictionHttp extends Http implements RestrictionRepository {
159161 map ( ( response : { response : ClientResponse ; body : MosaicGlobalRestrictionDTO ; } ) => {
160162 const payload = response . body . mosaicRestrictionEntry ;
161163 const restirctionItems = new Map < string , MosaicGlobalRestrictionItem > ( ) ;
164+ payload . restrictions . forEach ( ( restriction ) =>
165+ restirctionItems . set ( restriction . key ,
166+ new MosaicGlobalRestrictionItem (
167+ new MosaicId ( restriction . restriction . referenceMosaicId ) ,
168+ restriction . restriction . restrictionValue ,
169+ restriction . restriction . restrictionType ,
170+ ) ) ) ;
162171 return new MosaicGlobalRestriction (
163172 payload . compositeHash ,
164173 payload . entryType . valueOf ( ) ,
165174 new MosaicId ( payload . mosaicId ) ,
166- payload . restrictions . map ( ( restriction ) => {
167- return restirctionItems . set ( restriction . key ,
168- new MosaicGlobalRestrictionItem (
169- new MosaicId ( restriction . restriction . referenceMosaicId ) ,
170- restriction . restriction . restrictionValue ,
171- restriction . restriction . restrictionType ,
172- ) ) ;
173- } ) ,
175+ restirctionItems ,
174176 ) ;
175177 } ) ,
176178 catchError ( ( error ) => throwError ( error ) ) ,
@@ -193,18 +195,18 @@ export class RestrictionHttp extends Http implements RestrictionRepository {
193195 const mosaicGlobalRestrictionsDTO = response . body ;
194196 return mosaicGlobalRestrictionsDTO . map ( ( payload ) => {
195197 const restirctionItems = new Map < string , MosaicGlobalRestrictionItem > ( ) ;
198+ payload . mosaicRestrictionEntry . restrictions . forEach ( ( restriction ) =>
199+ restirctionItems . set ( restriction . key ,
200+ new MosaicGlobalRestrictionItem (
201+ new MosaicId ( restriction . restriction . referenceMosaicId ) ,
202+ restriction . restriction . restrictionValue ,
203+ restriction . restriction . restrictionType ,
204+ ) ) ) ;
196205 return new MosaicGlobalRestriction (
197206 payload . mosaicRestrictionEntry . compositeHash ,
198207 payload . mosaicRestrictionEntry . entryType . valueOf ( ) ,
199208 new MosaicId ( payload . mosaicRestrictionEntry . mosaicId ) ,
200- payload . mosaicRestrictionEntry . restrictions . map ( ( restriction ) => {
201- return restirctionItems . set ( restriction . key ,
202- new MosaicGlobalRestrictionItem (
203- new MosaicId ( restriction . restriction . referenceMosaicId ) ,
204- restriction . restriction . restrictionValue ,
205- restriction . restriction . restrictionType ,
206- ) ) ;
207- } ) ,
209+ restirctionItems ,
208210 ) ;
209211 } ) ;
210212 } ) ,
0 commit comments