Skip to content

Commit

Permalink
add a fallback if spawnSync fails the first time
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaineHeffron committed May 9, 2024
1 parent 9a4aafa commit 8d1303e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/e2e/src/test-contract-client-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ async function clientFromConstructor(contract, { keypair = generateFundedKeypair
const xdr = JSON.parse(spawnSync("./target/bin/soroban", ["contract", "inspect", "--wasm", path, "--output", "xdr-base64-array"], { shell: true, encoding: "utf8" }).stdout.trim())

const spec = new ContractSpec(xdr);
const wasmHash = contracts[contract].hash;
let wasmHash = contracts[contract].hash;
if (!wasmHash) {
throw new Error(`No wasm hash found for \`contracts[${contract}]\`! ${JSON.stringify(contracts[contract], null, 2)}`)
wasmHash = spawnSync("./target/bin/soroban", ["contract", "install", "--wasm", path], { shell: true, encoding: "utf8" }).stdout.trim()
}

// TODO: do this with js-stellar-sdk, instead of shelling out to the CLI
Expand Down

0 comments on commit 8d1303e

Please sign in to comment.