Skip to content

Commit

Permalink
Merge pull request #118 from eco-stake/adjust-last-restake-query
Browse files Browse the repository at this point in the history
Change last exec query to only use a single query/event
  • Loading branch information
tombeynon authored Dec 14, 2024
2 parents 7552640 + 66a1fc5 commit c068c27
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/ValidatorModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c068c27

Please sign in to comment.