Skip to content

Commit

Permalink
fix: add wasmHash fallback
Browse files Browse the repository at this point in the history
Sometimes `spawnSync` doesn't actually work synchronously and you need
to try again?
  • Loading branch information
chadoh committed May 15, 2024
1 parent 83494ea commit 007e1ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/e2e/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ async function clientFor(contract, { keypair = generateFundedKeypair(), contract
keypair = await keypair // eslint-disable-line no-param-reassign
const wallet = basicNodeSigner(keypair, networkPassphrase)

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", contracts[contract].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 007e1ce

Please sign in to comment.