Skip to content

Commit

Permalink
Fix token-js CI tests (solana-labs#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry authored Aug 30, 2020
1 parent 1247e53 commit 8e1bff0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
14 changes: 7 additions & 7 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ js_token() {
time npm run flow || exit $?
tsc module.d.ts || exit $?

# TODO: Uncomment when resolving https://github.com/solana-labs/solana-program-library/issues/332
# npm run cluster:localnet || exit $?
# npm run localnet:down
# npm run localnet:update || exit $?
# npm run localnet:up || exit $?
# time npm run start || exit $?
# npm run localnet:down
npm run cluster:localnet || exit $?
npm run localnet:down
npm run localnet:update || exit $?
npm run localnet:up || exit $?
time npm run start || exit $?
time PROGRAM_VERSION=2.0.3 npm run start || exit $?
npm run localnet:down
}
_ js_token

Expand Down
12 changes: 11 additions & 1 deletion token/js/cli/token-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,21 @@ async function loadProgram(
const from = await newAccountWithLamports(connection, balanceNeeded);
const program_account = new Account();
console.log('Loading program:', path);
await BpfLoader.load(connection, from, program_account, data, 1);
await BpfLoader.load(connection, from, program_account, data, 2);
return program_account.publicKey;
}

async function GetPrograms(connection: Connection): Promise<PublicKey> {
const programVersion = process.env.PROGRAM_VERSION;
if (programVersion) {
switch (programVersion) {
case '2.0.3':
return new PublicKey('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA');
default:
throw new Error('Unknown program version');
}
}

const store = new Store();
let tokenProgramId = null;
try {
Expand Down

0 comments on commit 8e1bff0

Please sign in to comment.