Skip to content

Commit

Permalink
neeext
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed May 12, 2023
1 parent 668988d commit eba4c41
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 45 deletions.
18 changes: 1 addition & 17 deletions packages/deployment/upgrade-test/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,6 @@ TARGET=agoric-upgrade-8 make build run
This will put you in `/usr/src/agoric-sdk`. You'll run commands from here. `upgrade-test-scripts` is copied here with only the test scripts for the current image.


```sh
# TODO build images with this
chmod 755 upgrade-test-scripts/*/*.sh

# run pretest to check preconditions are valid
# NB: must have no side-effects
upgrade-test-scripts/$THIS_NAME/pre_test.sh || echo PRETEST FAILED

# run the actions to set up some state we want to test
# NB: this is where side-effects go that can affect higher layers of Docker images
upgrade-test-scripts/$THIS_NAME/actions.sh || echo ACTIONS FAILED

# run the tests to check values
# NB: must have no side-effects
upgrade-test-scripts/$THIS_NAME/test.sh || echo TEST FAILED
```

If you lose the connection and want to get back,
```sh
# find the container id
Expand Down Expand Up @@ -86,6 +69,7 @@ By default targets that use "agoric-sdk:latest" will source from CI builds. To u
```shell
make local_sdk
```
Builds an image: ghcr.io/agoric/agoric-sdk:latest that will be used by all your builds.

That will produce the an image tagged agoric-sdk:latest in your local resolution. (Then run `make build run` again.)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,57 +1,84 @@
#!/bin/bash

# TODO should env_setup do this for all?
set -ueo pipefail
# set -ueo pipefail

source ./upgrade-test-scripts/env_setup.sh

# FIXME the script doesn't pass so the build fails if we let it run
exit 0
# UNTIL we have confidence this script will succeed and let the build complete
#exit 0

# For development:
# TARGET=agoric-upgrade-10 make local_sdk build run
# agoric wallet show --from $GOV1ADDR

echo Accept invitations to economic committee
agops ec committee --send-from gov1 || echo gov1 already accepted EC
agops ec committee --send-from gov2 || echo gov2 already accepted EC
agops ec committee --send-from gov3 || echo gov3 already accepted EC
echo Tickling the wallets so they are revived
# Until they are revived, the invitations can't be deposited. So the first action can't be to accept an invitation (because it won't be there).
govaccounts=("$GOV1ADDR" "$GOV2ADDR" "$GOV3ADDR")
for i in "${govaccounts[@]}"; do
for run in {1..2}; do
echo "$i: $run: Accepting EC Committee"
if [[ "$run" == "1" ]]; then
timeout 3 yarn run --silent agops ec committee --send-from "$i"
else
agops ec committee --send-from "$i"
fi
done
echo "$i: Accepting EC Charter"
agops ec charter --send-from "$i"
done

oracles=("$GOV1ADDR" "$GOV2ADDR")
for i in "${oracles[@]}"; do
echo "$i: Accept oracle invitations"
ORACLE_OFFER=$(mktemp -t agops.XXX)
agops oracle accept >|"$ORACLE_OFFER"
agoric wallet print --file "$ORACLE_OFFER"
agops perf satisfaction --from $i --executeOffer $ORACLE_OFFER --keyring-backend=test
done

# verify the offerId is readable from chain history
# agoric wallet show --from gov1 --keyring-backend="test"

#StartFrequency: 600s (auction runs every 10m)
#ClockStep: 20s (ensures auction completes in time)

echo Open a vault
OFFER=$(mktemp -t agops.XXX)
agops vaults open --wantMinted 5.00 --giveCollateral 9.0 >|"$OFFER"
# agoric wallet print --file "$OFFER"
agoric wallet send --offer "$OFFER" --from gov1 --keyring-backend="test"

echo Accept invitations to the charter
agops ec charter --send-from gov1 || echo gov1 already accepted charter
agops ec charter --send-from gov2 || echo gov2 already accepted charter
agops ec charter --send-from gov3 || echo gov3 already accepted charter
# should have the vault
# VAULT_PATH=$(agops vaults list --from $GOV1ADDR | head -1)
# agoric follow -F :$VAULT_PATH

# TODO test bidding
# TODO
# agops inter bid by-price --price 1 --give 1.0IST --from $GOV1ADDR --keyring-backend test

echo Look up the ids from vstorage.
# You can debug the 'for' option with `find-continuing-id` to see the `description` fields
CHARTER_OFFER_ID=$(
agops ec find-continuing-id --for "charter member invitation" --from gov1
)

echo Propose a MintLimit high enough to open vaults
echo Propose a new MintLimit for IST-AUSD
NEW_MINT_LIMIT=123456 # IST whole numbers
PROPOSAL_OFFER=$(mktemp -t agops.XXX)
agops psm proposeChangeMintLimit --limit $NEW_MINT_LIMIT --deadline 1 --previousOfferId "$CHARTER_OFFER_ID" >|"$PROPOSAL_OFFER"
# agoric wallet print --file "$PROPOSAL_OFFER"
agoric wallet send --offer "$PROPOSAL_OFFER" --from gov1 --keyring-backend="test"
# FIXME this should show the new question but still has the pauseOffers question
agoric follow -F :published.committees.Economic_Committee.latestQuestion
agops perf satisfaction --executeOffer "$PROPOSAL_OFFER" --from gov1 --keyring-backend="test"
# agoric follow -F :published.committees.Economic_Committee.latestQuestion

### can't vote until the proposal is published
###
###
test_val $(agoric follow -F :published.committees.Economic_Committee.latestQuestion -o jsonlines | jq -r .positions[0].changes.MintLimit.value) 123456000000

echo Vote to enact the new MintLimit
VOTE_OFFER=$(mktemp -t agops.XXX)
agops ec vote --forPosition 0 --send-from gov1 >|"$VOTE_OFFER"
echo Vote to enact the new MintLimit 1000
agops ec vote --forPosition 0 --send-from gov1
agops ec vote --forPosition 0 --send-from gov2
agops ec vote --forPosition 0 --send-from gov3

# agoric wallet show --from $GOV1ADDR

# agops psm info
test_val $(agoric follow -F :published.psm.IST.AUSD.governance -o jsonlines | jq -r '.current.MintLimit.value.value') 123456000000

# oracles
# agops oracle accept --offerId $(newOfferId)
# open a vault

# bids
# agops inter bid by-price --price 1 --give 1.0IST --from $GOV1ADDR --keyring-backend test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

. ./upgrade-test-scripts/env_setup.sh

echo Wait for upgrade to settle
waitForBlock 20

# ensure there's only uist
test_val "$(agd q bank balances agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346 -o json | jq -r '.balances | length')" "1"
test_val "$(agd q bank balances agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346 -o json | jq -r '.balances[0].denom')" "uist"
Expand Down

0 comments on commit eba4c41

Please sign in to comment.