@@ -101,14 +101,15 @@ export class RestrictionHttp extends Http implements RestrictionRepository {
101
101
map ( ( response : { response : ClientResponse ; body : MosaicAddressRestrictionDTO ; } ) => {
102
102
const payload = response . body . mosaicRestrictionEntry ;
103
103
const restirctionItems = new Map < string , string > ( ) ;
104
+ payload . restrictions . forEach ( ( restriction ) => {
105
+ restirctionItems . set ( restriction . key , restriction . value ) ;
106
+ } ) ;
104
107
return new MosaicAddressRestriction (
105
108
payload . compositeHash ,
106
109
payload . entryType ,
107
110
new MosaicId ( payload . mosaicId ) ,
108
111
Address . createFromEncoded ( payload . targetAddress ) ,
109
- payload . restrictions . map ( ( restriction ) => {
110
- return restirctionItems . set ( restriction . key , restriction . value ) ;
111
- } ) ,
112
+ restirctionItems ,
112
113
) ;
113
114
} ) ,
114
115
catchError ( ( error ) => throwError ( error ) ) ,
@@ -132,14 +133,15 @@ export class RestrictionHttp extends Http implements RestrictionRepository {
132
133
const mosaicAddressRestrictionsDTO = response . body ;
133
134
return mosaicAddressRestrictionsDTO . map ( ( payload ) => {
134
135
const restirctionItems = new Map < string , string > ( ) ;
136
+ payload . mosaicRestrictionEntry . restrictions . forEach ( ( restriction ) => {
137
+ restirctionItems . set ( restriction . key , restriction . value ) ;
138
+ } ) ;
135
139
return new MosaicAddressRestriction (
136
140
payload . mosaicRestrictionEntry . compositeHash ,
137
141
payload . mosaicRestrictionEntry . entryType ,
138
142
new MosaicId ( payload . mosaicRestrictionEntry . mosaicId ) ,
139
143
Address . createFromEncoded ( payload . mosaicRestrictionEntry . targetAddress ) ,
140
- payload . mosaicRestrictionEntry . restrictions . map ( ( restriction ) => {
141
- return restirctionItems . set ( restriction . key , restriction . value ) ;
142
- } ) ,
144
+ restirctionItems ,
143
145
) ;
144
146
} ) ;
145
147
} ) ,
@@ -159,18 +161,18 @@ export class RestrictionHttp extends Http implements RestrictionRepository {
159
161
map ( ( response : { response : ClientResponse ; body : MosaicGlobalRestrictionDTO ; } ) => {
160
162
const payload = response . body . mosaicRestrictionEntry ;
161
163
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
+ ) ) ) ;
162
171
return new MosaicGlobalRestriction (
163
172
payload . compositeHash ,
164
173
payload . entryType . valueOf ( ) ,
165
174
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 ,
174
176
) ;
175
177
} ) ,
176
178
catchError ( ( error ) => throwError ( error ) ) ,
@@ -193,18 +195,18 @@ export class RestrictionHttp extends Http implements RestrictionRepository {
193
195
const mosaicGlobalRestrictionsDTO = response . body ;
194
196
return mosaicGlobalRestrictionsDTO . map ( ( payload ) => {
195
197
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
+ ) ) ) ;
196
205
return new MosaicGlobalRestriction (
197
206
payload . mosaicRestrictionEntry . compositeHash ,
198
207
payload . mosaicRestrictionEntry . entryType . valueOf ( ) ,
199
208
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 ,
208
210
) ;
209
211
} ) ;
210
212
} ) ,
0 commit comments