Skip to content

Commit 7f54f42

Browse files
authored
Ship 64 pubs (#1144)
1 parent 9335898 commit 7f54f42

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

governance/xc_admin/packages/xc_admin_common/src/cluster.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,22 @@ export function getMultisigCluster(cluster: PythCluster): Cluster | "localnet" {
2727
return cluster;
2828
}
2929
}
30+
31+
export function getMaximumNumberOfPublishers(cluster: PythCluster) {
32+
switch (cluster) {
33+
case "mainnet-beta":
34+
return 32;
35+
case "devnet":
36+
return 32;
37+
case "testnet":
38+
return 32;
39+
case "pythnet":
40+
return 32;
41+
case "pythtest-conformance":
42+
return 64;
43+
case "pythtest-crosschain":
44+
return 64;
45+
case "localnet":
46+
return 32;
47+
}
48+
}

governance/xc_admin/packages/xc_admin_frontend/components/PermissionDepermissionKey.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import axios from 'axios'
1010
import { Fragment, useContext, useEffect, useState } from 'react'
1111
import toast from 'react-hot-toast'
1212
import {
13+
getMaximumNumberOfPublishers,
1314
getMultisigCluster,
1415
isRemoteCluster,
1516
mapKey,
@@ -144,7 +145,8 @@ const PermissionDepermissionKey = ({
144145
(selectedAssetType === 'All' ||
145146
product.metadata.asset_type === selectedAssetType) &&
146147
((isPermission &&
147-
product.priceAccounts[0].publishers.length < 32 &&
148+
product.priceAccounts[0].publishers.length <
149+
getMaximumNumberOfPublishers(cluster) &&
148150
!publisherExists) ||
149151
(!isPermission && publisherExists))
150152
) {

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
WORMHOLE_ADDRESS,
2222
PRICE_FEED_OPS_KEY,
2323
getMessageBufferAddressForPrice,
24+
getMaximumNumberOfPublishers,
2425
} from 'xc_admin_common'
2526
import { ClusterContext } from '../../contexts/ClusterContext'
2627
import { useMultisigContext } from '../../contexts/MultisigContext'
@@ -263,10 +264,16 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
263264
}
264265
})
265266

266-
// check that no price account has more than 32 publishers
267+
// check that no price account has more than the maximum number of publishers
267268
Object.keys(jsonParsed).forEach((symbol) => {
268-
if (jsonParsed[symbol].priceAccounts[0].publishers.length > 32) {
269-
toast.error(`${symbol} has more than 32 publishers.`)
269+
const maximumNumberOfPublishers = getMaximumNumberOfPublishers(cluster)
270+
if (
271+
jsonParsed[symbol].priceAccounts[0].publishers.length >
272+
maximumNumberOfPublishers
273+
) {
274+
toast.error(
275+
`${symbol} has more than ${maximumNumberOfPublishers} publishers.`
276+
)
270277
isValid = false
271278
}
272279
})

0 commit comments

Comments
 (0)