Skip to content

Commit

Permalink
feat(bundle-cost): find proposal tx from number via proposer
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc authored and turadg committed Jan 26, 2024
1 parent 474bbd7 commit 0ad4642
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 2 additions & 0 deletions proposals/61:lo-bundle-cost/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
proposer-61.json
tx-hist-proposer-61.json
21 changes: 12 additions & 9 deletions proposals/61:lo-bundle-cost/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@
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:
rm -f lower-bundle-cost.json

# 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

0 comments on commit 0ad4642

Please sign in to comment.