Skip to content

Commit a549d53

Browse files
authored
[xc-admin] Output symbol when more than 32 publishers (#625)
* Make change * Add check for duplicates * Remove console log
1 parent 8cb720c commit a549d53

File tree

1 file changed

+12
-1
lines changed
  • governance/xc_admin/packages/xc_admin_frontend/components/tabs

1 file changed

+12
-1
lines changed

governance/xc_admin/packages/xc_admin_frontend/components/tabs/General.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,21 @@ const General = () => {
245245
}
246246
})
247247

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+
248259
// check that no price account has more than 32 publishers
249260
Object.keys(jsonParsed).forEach((symbol) => {
250261
if (jsonParsed[symbol].priceAccounts[0].publishers.length > 32) {
251-
toast.error(`A price account can't have more than 32 publishers.`)
262+
toast.error(`${symbol} has more than 32 publishers.`)
252263
isValid = false
253264
}
254265
})

0 commit comments

Comments
 (0)