Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: --recover to get mnemonic from file #137

Merged
merged 20 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a000996
fix: --recover to get mnemonic from file
dckc Apr 2, 2024
200e1ac
fix: update mnemonics so they're all different
LuqiPan Apr 2, 2024
358a1ff
test: add sanity test for upgrade-8 to check addresses are expected
LuqiPan Apr 2, 2024
7759b1f
chore: make constants actually constants now that we know the addresses
LuqiPan Apr 2, 2024
a7f6157
test: update keys.test.js to test environment variables are set corre…
LuqiPan Apr 2, 2024
a32c163
test: update use.sh script to run yarn ava on test.js files
LuqiPan Apr 2, 2024
5a2e4a1
chore: undo my modification to use.sh in upgrade-9
LuqiPan Apr 2, 2024
fa050f3
chore: add ava as a dev dependency in package.json of upgrade-8
LuqiPan Apr 2, 2024
3e191c6
chore: run yarn ava keys.test.js in upgrade-8/test.sh
LuqiPan Apr 2, 2024
7426f2a
chore: change the name of the test file to addresses.test.js
LuqiPan Apr 2, 2024
50a41ca
test: ask yarn to ignore node version with YARN_IGNORE_NODE
LuqiPan Apr 2, 2024
accb98d
chore: run synthetic-chain doctor which adds .yarnrc.yml file
LuqiPan Apr 2, 2024
8263c8f
chore: add `@agoric/synthetic-chain` as dependency to package.json
LuqiPan Apr 3, 2024
a983c00
chore: add `agops` yarn script and update import path
LuqiPan Apr 3, 2024
46b6f9b
chore: update import path for upgrade-9/sanity.test.js
LuqiPan Apr 3, 2024
dc82ee5
chore: enable YARN_IGNORE_NODE flag for upgrade-9/test.sh too
LuqiPan Apr 3, 2024
c8147f8
chore: add set -e to upgrade-9/test.sh
LuqiPan Apr 3, 2024
7c2cde2
chore: add `@agoric/synthetic-chain` as dev dependency
LuqiPan Apr 3, 2024
e7bf1ca
debug: remove set -e from upgrade-9/test.sh for now
LuqiPan Apr 3, 2024
22bcc8f
chore: use the local version of @agoric/synthetic-chain
LuqiPan Apr 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
spike siege world rather ordinary upper napkin voice brush oppose junior route trim crush expire angry seminar anchor panther piano image pepper chest alone
tackle hen gap lady bike explain erode midnight marriage wide upset culture model select dial trial swim wood step scan intact what card symptom
Original file line number Diff line number Diff line change
@@ -1 +1 @@
spike siege world rather ordinary upper napkin voice brush oppose junior route trim crush expire angry seminar anchor panther piano image pepper chest alone
soap hub stick bomb dish index wing shield cruel board siren force glory assault rotate busy area topple resource okay clown wedding hint unhappy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ agd init localnet --chain-id "$CHAINID"

allaccounts=("gov1" "gov2" "gov3" "user1" "validator")
for i in "${allaccounts[@]}"; do
cat "/usr/src/upgrade-test-scripts/keys_for_test_only/$i.key" | agd keys add $i --keyring-backend=test 2>&1
cat "/usr/src/upgrade-test-scripts/keys_for_test_only/$i.key" | agd keys add $i --recover --keyring-backend=test 2>&1
done

source /usr/src/upgrade-test-scripts/env_setup.sh
Expand Down
10 changes: 5 additions & 5 deletions packages/synthetic-chain/src/lib/constants.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export const BINARY = process.env.binary;

export const GOV1ADDR = process.env.GOV1ADDR;
export const GOV2ADDR = process.env.GOV2ADDR;
export const GOV3ADDR = process.env.GOV3ADDR;
export const USER1ADDR = process.env.USER1ADDR;
export const VALIDATORADDR = process.env.VALIDATORADDR;
export const GOV1ADDR = 'agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q';
export const GOV2ADDR = 'agoric1wrfh296eu2z34p6pah7q04jjuyj3mxu9v98277';
export const GOV3ADDR = 'agoric1ydzxwh6f893jvpaslmaz6l8j2ulup9a7x8qvvq';
export const USER1ADDR = 'agoric1rwwley550k9mmk6uq6mm6z4udrg8kyuyvfszjk';
export const VALIDATORADDR = 'agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl';

export const PSM_PAIR = process.env.PSM_PAIR;
export const ATOM_DENOM = process.env.ATOM_DENOM;
Expand Down
30 changes: 30 additions & 0 deletions proposals/16:upgrade-8/keys.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/** @file adapted from upgrade-9's sanity test, ensure addresses are what we expected */
import test from 'ava';

import {
GOV1ADDR,
GOV2ADDR,
GOV3ADDR,
USER1ADDR,
VALIDATORADDR,
} from '@agoric/synthetic-chain/src/lib/constants.js';

test('gov1 address', async t => {
t.is(process.env.GOV1ADDR, GOV1ADDR);
});

test('gov2 address', async t => {
t.is(process.env.GOV2ADDR, GOV2ADDR);
});

test('gov3 address', async t => {
t.is(process.env.GOV3ADDR, GOV3ADDR);
});

test('user1 address', async t => {
t.is(process.env.USER1ADDR, USER1ADDR);
});

test('validator address', async t => {
t.is(process.env.VALIDATORADDR, VALIDATORADDR);
});
2 changes: 2 additions & 0 deletions proposals/16:upgrade-8/use.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -e

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

yarn ava keys.test.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this just debugging? tests don't belong in use.sh. the ones here are tech debt

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I noticed keys.test.js was not run and found an example of running it in use.sh

I've since moved it to test.sh


# XXX fix bug in this SDK's verison of agops
sed -i "s/--econCommAcceptOfferId /--previousOfferId /g" "/usr/src/agoric-sdk/packages/agoric-cli/src/commands/psm.js"

Expand Down
2 changes: 2 additions & 0 deletions proposals/29:upgrade-9/use.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -e

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

yarn ava sanity.test.js

# Set to zero so tests don't have to pay gas (we're not testing that)
sed --in-place=.bak s/'minimum-gas-prices = ""'/'minimum-gas-prices = "0ubld,0uist"'/ ~/.agoric/config/app.toml

Expand Down
Loading