@@ -95,10 +95,9 @@ async function getNodeOperatorInfo(contract, nodeOperatorId) {
9595 }
9696
9797 const nodeOperator = await contract . methods . getNodeOperator ( nodeOperatorId ) . call ( ) ;
98- const enqueuedCount = nodeOperator . enqueuedCount ;
9998
10099 //log.info("Enqueued Count:", enqueuedCount);
101- return enqueuedCount ;
100+ return nodeOperator ;
102101 } catch ( error ) {
103102 log . error ( "Error calling getNodeOperator:" , error ) ;
104103 return null ;
@@ -240,7 +239,8 @@ async function getSigningKeysWithQueueInfo(monitoring) {
240239 }
241240
242241 // Retrieve enqueued count
243- const enqueuedCount = await getNodeOperatorInfo ( contract , nodeOperatorId ) ;
242+ const nodeOperatorInfo = await getNodeOperatorInfo ( contract , nodeOperatorId ) ;
243+ const enqueuedCount = nodeOperatorInfo . enqueuedCount ;
244244 if ( enqueuedCount === null || enqueuedCount <= 0 ) {
245245 log . info ( "No enqueued validators for this Node Operator." ) ;
246246 }
@@ -253,7 +253,7 @@ async function getSigningKeysWithQueueInfo(monitoring) {
253253 }
254254
255255 // Retrieve the signing keys
256- const signingKeys = await getSigningKeys ( contract , nodeOperatorId , 0 , numberOfNoneWithdrawnKeys ) ;
256+ const signingKeys = await getSigningKeys ( contract , nodeOperatorId , 0 , nodeOperatorInfo . totalAddedKeys ) ;
257257 if ( ! signingKeys ) {
258258 log . info ( "Failed to retrieve signing keys." ) ;
259259 return null ;
@@ -380,7 +380,7 @@ async function checkSigningKeys(keysArray, monitoring) {
380380 }
381381
382382 // Retrieve enqueuedCount and ensure it's above 0
383- const enqueuedCount = await getNodeOperatorInfo ( contract , nodeOperatorId ) ;
383+ const enqueuedCount = ( await getNodeOperatorInfo ( contract , nodeOperatorId ) ) . enqueuedCount ;
384384 if ( enqueuedCount === null || enqueuedCount <= 0 ) {
385385 log . info ( "No enqueued validators for this Node Operator." ) ;
386386 return false ;
0 commit comments