Skip to content

Commit

Permalink
fetch proposal 76 details from the chain (#175)
Browse files Browse the repository at this point in the history
* chore: automate fetching parts of CoreEval proposal 76

* chore: save complete transaction for proposal 76

* chore: tweak whitespace to match on-chain data

* fixup! chore: automate fetching parts of CoreEval proposal 76
  • Loading branch information
dckc authored Sep 9, 2024
1 parent 5c317a5 commit cc1fc8a
Show file tree
Hide file tree
Showing 5 changed files with 457 additions and 0 deletions.
3 changes: 3 additions & 0 deletions proposals/76:vaults-auctions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# intermediate files on the way to finding the tx
proposer.json
proposer-tx-hist.json
49 changes: 49 additions & 0 deletions proposals/76:vaults-auctions/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This Makefile is here to help you find out what went on the
# chain for a CoreEval proposal such as #76 for vaults / auctions.
PROPOSAL=76

##
# Find the proposal transaction

# To find the transaction, let's start with: Who proposed 76?
proposer.json:
agd --node $(ARCHIVE_NODE) query gov proposer $(PROPOSAL) -o json >$@

# Get proposer's tranasction history.
proposer-tx-hist.json: proposer.json
PROPOSER="$$(jq -r .proposer $<)"; \
agd --node $(ARCHIVE_NODE) query txs --events="message.sender=$$PROPOSER" -o json >$@

# pick out their most recent CoreEvalProposal
tx.json: proposer-tx-hist.json
jq '.txs | .[] | select(.tx.body.messages[0].content["@type"] == "/agoric.swingset.CoreEvalProposal")' \
$< >$@

# A CoreEval proposal has a sequence of json_permits,js_code pairs.
# We happen to know there were 2 in this case, and we have
# been using certain filenames for them.

EVALS=submission/add-auction-permit.json submission/add-auction.js \
submission/upgrade-vaults-permit.json submission/upgrade-vaults.js

core-evals: $(EVALS)

# Now pick out their contents from the transaction.
submission/add-auction-permit.json: tx.json
jq -r '.tx.body.messages[0].content.evals[0].json_permits' $< >$@
submission/add-auction.js: tx.json
jq -r '.tx.body.messages[0].content.evals[0].js_code' $< >$@

submission/upgrade-vaults-permit.json: tx.json
jq -r '.tx.body.messages[0].content.evals[1].json_permits' $< >$@
submission/upgrade-vaults.js: tx.json
jq -r '.tx.body.messages[0].content.evals[1].js_code' $< >$@


# clean up locally computed files
clean:
rm -f $(EVALS)

# clean up files cached from the network as well
realclean: clean
rm -f tx.json proposer.json tx-hist-proposer.json
1 change: 1 addition & 0 deletions proposals/76:vaults-auctions/submission/add-auction.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,4 @@ const behavior = (({
return coreProposalBehavior;
})({ manifestBundleRef, getManifestCall, customManifest, E });
behavior;

1 change: 1 addition & 0 deletions proposals/76:vaults-auctions/submission/upgrade-vaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,4 @@ const behavior = (({
return coreProposalBehavior;
})({ manifestBundleRef, getManifestCall, customManifest, E });
behavior;

Loading

0 comments on commit cc1fc8a

Please sign in to comment.