Skip to content

Commit de7e3f9

Browse files
fix(protocol-dashboard): fetch latest validator version via getNumberOfVersions (#14355)
## Summary - `getCurrentVersion` on the ServiceTypeManager contract was returning a stale version (1.0.0) for the `Validator` service type — the home page and other locations using `useCurrentVersion(ServiceType.Validator)` displayed the wrong number. - Switch `fetchCurrentVersion` to read the latest registered version by calling `getNumberOfVersions(serviceType)` and then `getVersion(serviceType, numberOfVersions - 1)`. The latest onchain validator version (1.1.0) now shows correctly. ## Test plan - [ ] Open the dashboard logged out — verify the `Register a Node` card shows the latest onchain version (currently `1.1.0`) instead of `1.0.0`. - [ ] Open a user/services page that renders `RegisterNodeCard` — verify the same. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent c93a265 commit de7e3f9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • packages/protocol-dashboard/src/store/cache/protocol

packages/protocol-dashboard/src/store/cache/protocol/hooks.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ export function fetchCurrentVersion(
8484
serviceType: ServiceType
8585
): ThunkAction<void, AppState, Audius, Action<string>> {
8686
return async (dispatch, getState, aud) => {
87-
const currentVersion = await aud.NodeType.getCurrentVersion(serviceType)
87+
const numberOfVersions =
88+
await aud.NodeType.getNumberOfVersions(serviceType)
89+
const currentVersion = await aud.NodeType.getVersion(
90+
serviceType,
91+
numberOfVersions - 1
92+
)
8893
dispatch(setCurrentVersion({ serviceType, currentVersion }))
8994
}
9095
}

0 commit comments

Comments
 (0)