diff --git a/ci/script.sh b/ci/script.sh index 082cfadca4dcad..752e0ece0a8559 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -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 diff --git a/token/js/cli/token-test.js b/token/js/cli/token-test.js index 94498703f18c38..69cd641f7e4cae 100644 --- a/token/js/cli/token-test.js +++ b/token/js/cli/token-test.js @@ -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 { + 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 {