[xc-admin] Output symbol when more than 32 publishers (#625)
* Make change * Add check for duplicates * Remove console log
This commit is contained in:
parent
8cb720c476
commit
a549d535f8
|
@ -245,10 +245,21 @@ const General = () => {
|
|||
}
|
||||
})
|
||||
|
||||
// check that there are no duplicate publishers
|
||||
Object.keys(jsonParsed).forEach((symbol) => {
|
||||
if (
|
||||
new Set(jsonParsed[symbol].priceAccounts[0].publishers).size !=
|
||||
jsonParsed[symbol].priceAccounts[0].publishers.length
|
||||
) {
|
||||
toast.error(`${symbol} has a duplicate publisher.`)
|
||||
isValid = false
|
||||
}
|
||||
})
|
||||
|
||||
// check that no price account has more than 32 publishers
|
||||
Object.keys(jsonParsed).forEach((symbol) => {
|
||||
if (jsonParsed[symbol].priceAccounts[0].publishers.length > 32) {
|
||||
toast.error(`A price account can't have more than 32 publishers.`)
|
||||
toast.error(`${symbol} has more than 32 publishers.`)
|
||||
isValid = false
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue