diff --git a/ui/src/components/ValidatorDetails/StakingDetails.tsx b/ui/src/components/ValidatorDetails/StakingDetails.tsx index ee4af3ca..52060564 100644 --- a/ui/src/components/ValidatorDetails/StakingDetails.tsx +++ b/ui/src/components/ValidatorDetails/StakingDetails.tsx @@ -42,7 +42,7 @@ import { ellipseAddressJsx } from '@/utils/ellipseAddress' import { ExplorerLink } from '@/utils/explorer' import { convertFromBaseUnits, roundToFirstNonZeroDecimal } from '@/utils/format' import { cn } from '@/utils/ui' -import { Constraints } from '@/contracts/ValidatorRegistryClient' +import { Constraints, NodePoolAssignmentConfig } from '@/contracts/ValidatorRegistryClient' interface StakingDetailsProps { validator: Validator @@ -233,6 +233,17 @@ export function StakingDetails({ validator, constraints, stakesByValidator }: St ) } + function nodeNumForPoolId(poolAppId: bigint, poolAssignments: NodePoolAssignmentConfig) { + for (let nodeIndex = 0; nodeIndex < poolAssignments.nodes.length; nodeIndex++) { + for (let poolIndex = 0; poolIndex < poolAssignments.nodes[nodeIndex][0].length; poolIndex++) { + if (poolAssignments.nodes[nodeIndex][0][poolIndex] === poolAppId) { + return nodeIndex + 1 + } + } + } + return undefined + } + const renderPoolInfo = () => { if (!selectedPoolInfo) { return ( @@ -345,6 +356,15 @@ export function StakingDetails({ validator, constraints, stakesByValidator }: St +
+
Node Number
+
+ + {nodeNumForPoolId(selectedPoolInfo.poolAppId, validator.nodePoolAssignment)} + +
+
+
Algod version