From 9df5b42305c30c13ed69615ba5e7f06c8def278f Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Tue, 23 Jan 2024 11:09:05 -0600 Subject: [PATCH] feat(bundle-cost): find proposal tx from number via proposer --- proposals/61:lo-bundle-cost/.gitignore | 2 ++ proposals/61:lo-bundle-cost/Makefile | 21 ++++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 proposals/61:lo-bundle-cost/.gitignore diff --git a/proposals/61:lo-bundle-cost/.gitignore b/proposals/61:lo-bundle-cost/.gitignore new file mode 100644 index 00000000..a291e3bb --- /dev/null +++ b/proposals/61:lo-bundle-cost/.gitignore @@ -0,0 +1,2 @@ +proposer-61.json +tx-hist-proposer-61.json diff --git a/proposals/61:lo-bundle-cost/Makefile b/proposals/61:lo-bundle-cost/Makefile index d09dd5ec..96401f47 100644 --- a/proposals/61:lo-bundle-cost/Makefile +++ b/proposals/61:lo-bundle-cost/Makefile @@ -6,14 +6,17 @@ lower-bundle-cost.json: tx-61.json jq '.tx.body.messages[0].content | .changes[0].value |= fromjson' tx-61.json >$@ -# To get the hash of the tx for proposal 61, -# we found the proposer (either using an explorer or -# `agd --node $ARCHIVE_NODE query gov proposer 61`) -# and looked at their transaction history. -hash=6EA7B46DFDD0973338BB50781B33D651FE0E8EE8ABF4D7BCB1BF8235334AAFE0 -ARCHIVE_NODE="https://main-a.rpc.agoric.net:443" -tx-61.json: - agd --node $(ARCHIVE_NODE) query tx $(hash) -o json >$@ +PROPOSAL=61 +proposer-61.json: + agd --node $(ARCHIVE_NODE) query gov proposer $(PROPOSAL) -o json >$@ + +tx-hist-proposer-61.json: proposer-61.json + PROPOSER="$$(jq -r .proposer proposer-61.json)"; \ + agd --node $(ARCHIVE_NODE) query txs --events="message.sender=$$PROPOSER" -o json >$@ + +tx-61.json: tx-hist-proposer-61.json + jq '.txs | .[] | select(.tx.body.messages[0].content["@type"] == "/cosmos.params.v1beta1.ParameterChangeProposal")' \ + tx-hist-proposer-61.json >$@ # clean up locally computed files clean: @@ -21,4 +24,4 @@ clean: # clean up files cached from the network as well realclean: clean - rm -f tx-61.json + rm -f tx-61.json proposer-61.json tx-hist-proposer-61.json