diff --git a/Dockerfile b/Dockerfile index aa5c278..3f26c53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,9 +67,15 @@ RUN npm install -g ts-node yarn # Install js-soroban-client ARG JS_SOROBAN_CLIENT_NPM_VERSION ADD package.json /home/tester/ +ADD js-soroban-client /home/tester/js-soroban-client RUN sudo chown -R tester:tester /home/tester RUN yarn install --network-concurrency 1 -RUN yarn add "soroban-client@${JS_SOROBAN_CLIENT_NPM_VERSION}" --network-concurrency 1 +RUN if echo "$JS_SOROBAN_CLIENT_NPM_VERSION" | grep -q '.*file:.*'; then \ + yarn add ${JS_SOROBAN_CLIENT_NPM_VERSION} --network-concurrency 1; \ + else \ + yarn add "soroban-client@${JS_SOROBAN_CLIENT_NPM_VERSION}" --network-concurrency 1; \ + fi + ADD *.ts /home/tester/bin/ RUN ["sudo", "chmod", "+x", "/home/tester/bin/invoke.ts"] diff --git a/invoke.ts b/invoke.ts index 41a2a09..f19a234 100755 --- a/invoke.ts +++ b/invoke.ts @@ -38,18 +38,16 @@ async function main() { params.push(xdr.ScVal.scvSymbol(param)); }); } - - const txn = await server.prepareTransaction( - new SorobanClient.TransactionBuilder(sourceAccount, { + + const originalTxn = new SorobanClient.TransactionBuilder(sourceAccount, { fee: "100", networkPassphrase, }) .addOperation(contract.call(functionName, ...params)) .setTimeout(30) - .build(), - networkPassphrase - ); - + .build(); + + const txn = await server.prepareTransaction(originalTxn,networkPassphrase); txn.sign(secretKey); const send = await server.sendTransaction(txn); if (send.errorResultXdr) { diff --git a/js-soroban-client/README.md b/js-soroban-client/README.md new file mode 100644 index 0000000..375eed3 --- /dev/null +++ b/js-soroban-client/README.md @@ -0,0 +1,19 @@ +This is a placeholder file only. + +the system-teset/js-soroban-client directory can be used if you want to build system-test +with a local file path for the js-soroban-client project rather than pulling it from remote +npm or gh ref. + +js-soroban-client$ `yarn build` + +then copy the entire js-soroban-client directory over the top of system-test/js-soroban-client, +or soft link the directories, but be careful in soft link case as you don't want to accidentally delete, etc. + +once you have the system-teset/js-soroban-client ready, then build system-test and trigger it to use with: + +``` +make .... JS_SOROBAN_CLIENT_NPM_VERSION=file:/home/tester/js-soroban-client build + +``` + +system-teset/js-soroban-client is copied to the `/home/tester/js-soroban-client` path in the docker image.