From a62182579a57b65b7bba3792c8990d3cf53fe22b Mon Sep 17 00:00:00 2001 From: Nicholas Addison Date: Mon, 1 Jun 2026 16:32:44 +1000 Subject: [PATCH] Fix removeSsvValidator to work with Clusters with ETH payments --- contracts/utils/ssv.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/contracts/utils/ssv.js b/contracts/utils/ssv.js index 9594038ea3..c189496b64 100644 --- a/contracts/utils/ssv.js +++ b/contracts/utils/ssv.js @@ -15,6 +15,17 @@ const emptyCluster = { balance: 0, }; +const normalizeCluster = (cluster) => ({ + validatorCount: cluster.validatorCount, + networkFeeIndex: cluster.networkFeeIndex, + index: cluster.index, + active: cluster.active, + balance: + cluster.migrated && cluster.ethBalance !== undefined + ? cluster.ethBalance + : cluster.balance, +}); + const splitValidatorKey = async ({ keystorelocation, keystorepass, @@ -130,7 +141,7 @@ const getClusterInfo = async ({ ownerAddress, operatorids, chainId }) => { return { block: response.data.cluster.blockNumber, - cluster: response.data.cluster, + cluster: normalizeCluster(response.data.cluster), }; } catch (err) { if (err.response) { @@ -196,6 +207,7 @@ module.exports = { printClusterInfo, getClusterInfo, getClusterNonce, + normalizeCluster, sortOperatorIds, splitOperatorIds, splitValidatorKey,