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 = () => {
172172 const fileDataParsed = sortData ( JSON . parse ( fileData as string ) )
173173 const changes : Record < string , any > = { }
174174 Object . keys ( fileDataParsed ) . forEach ( ( symbol ) => {
175+ // remove duplicate publishers
176+ fileDataParsed [ symbol ] . priceAccounts [ 0 ] . publishers = [
177+ ...new Set ( fileDataParsed [ symbol ] . priceAccounts [ 0 ] . publishers ) ,
178+ ]
175179 if ( ! existingSymbols . has ( symbol ) ) {
176180 // if symbol is not in existing symbols, create new entry
177181 changes [ symbol ] = { new : { } }
@@ -245,17 +249,6 @@ const General = () => {
245249 }
246250 } )
247251
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-
259252 // check that no price account has more than 32 publishers
260253 Object . keys ( jsonParsed ) . forEach ( ( symbol ) => {
261254 if ( jsonParsed [ symbol ] . priceAccounts [ 0 ] . publishers . length > 32 ) {
You can’t perform that action at this time.
0 commit comments