File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
governance/xc_admin/packages/xc_admin_frontend/components/tabs Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,10 @@ const General = () => {
172
172
const fileDataParsed = sortData ( JSON . parse ( fileData as string ) )
173
173
const changes : Record < string , any > = { }
174
174
Object . keys ( fileDataParsed ) . forEach ( ( symbol ) => {
175
+ // remove duplicate publishers
176
+ fileDataParsed [ symbol ] . priceAccounts [ 0 ] . publishers = [
177
+ ...new Set ( fileDataParsed [ symbol ] . priceAccounts [ 0 ] . publishers ) ,
178
+ ]
175
179
if ( ! existingSymbols . has ( symbol ) ) {
176
180
// if symbol is not in existing symbols, create new entry
177
181
changes [ symbol ] = { new : { } }
@@ -245,17 +249,6 @@ const General = () => {
245
249
}
246
250
} )
247
251
248
- // check that there are no duplicate publishers
249
- Object . keys ( jsonParsed ) . forEach ( ( symbol ) => {
250
- if (
251
- new Set ( jsonParsed [ symbol ] . priceAccounts [ 0 ] . publishers ) . size !=
252
- jsonParsed [ symbol ] . priceAccounts [ 0 ] . publishers . length
253
- ) {
254
- toast . error ( `${ symbol } has a duplicate publisher.` )
255
- isValid = false
256
- }
257
- } )
258
-
259
252
// check that no price account has more than 32 publishers
260
253
Object . keys ( jsonParsed ) . forEach ( ( symbol ) => {
261
254
if ( jsonParsed [ symbol ] . priceAccounts [ 0 ] . publishers . length > 32 ) {
You can’t perform that action at this time.
0 commit comments