From 66a1fc54c7357e00dca8c2ae8a9adfd23b40fd50 Mon Sep 17 00:00:00 2001 From: Tom Beynon Date: Mon, 9 Dec 2024 15:09:35 +0000 Subject: [PATCH] Change last exec query to only use a single query/event --- src/components/ValidatorModal.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/ValidatorModal.js b/src/components/ValidatorModal.js index 0f7b34d..55a7996 100644 --- a/src/components/ValidatorModal.js +++ b/src/components/ValidatorModal.js @@ -106,16 +106,21 @@ function ValidatorModal(props) { const key = network.chain.sdk50OrLater ? 'query' : 'events' network.queryClient.getTransactions([ - { key: key, value: `message.action='/cosmos.authz.v1beta1.MsgExec'` }, + // { key: key, value: `message.action='/cosmos.authz.v1beta1.MsgExec'` }, { key: key, value: `message.sender='${operator.botAddress}'` } ], { - pageSize: 1, + pageSize: 3, order: 2, retries: 3, timeout: 15_000 }).then(data => { if (data.tx_responses?.length > 0) { - setLastExec(moment(data.tx_responses[0].timestamp)) + const lastExecResponse = data.tx_responses.find(tx => tx.tx.body.messages[0]['@type'] === '/cosmos.authz.v1beta1.MsgExec') + if(lastExecResponse){ + setLastExec(moment(lastExecResponse.timestamp)) + }else{ + setLastExec(false) + } } else if(emptyResponseRetries && lastExec == null) { getLastExec(emptyResponseRetries - 1) } else if(lastExec == null) {