-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fetch proposal 76 details from the chain (#175)
* 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
Showing
5 changed files
with
457 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.