Skip to content

Commit

Permalink
fix: update js-stellar-sdk; use it correctly
Browse files Browse the repository at this point in the history
I believe we were running into issues running these tests in CI. Since
they're not running in CI, they get stale quickly.
  • Loading branch information
chadoh committed Jul 30, 2024
1 parent ba24fda commit e91226f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
24 changes: 12 additions & 12 deletions cmd/crates/soroban-spec-typescript/ts-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/crates/soroban-spec-typescript/ts-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"ava": "^5.3.1",
"dotenv": "^16.3.1",
"eslint": "^8.53.0",
"@stellar/stellar-sdk": "12.1.0",
"@stellar/stellar-sdk": "12.2.0",
"typescript": "^5.3.3"
},
"ava": {
Expand Down
15 changes: 11 additions & 4 deletions cmd/crates/soroban-spec-typescript/ts-tests/src/util.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import { spawnSync } from "node:child_process";
import { Address, Keypair } from "@stellar/stellar-sdk";
import { basicNodeSigner } from "@stellar/stellar-sdk/ContractClient";
import { basicNodeSigner } from "@stellar/stellar-sdk/contract";

const rootKeypair = Keypair.fromSecret(spawnSync("./soroban", ["keys", "show", "root"], { shell: true, encoding: "utf8" }).stdout.trim());
const rootKeypair = Keypair.fromSecret(
spawnSync("./soroban", ["keys", "show", "root"], {
shell: true,
encoding: "utf8",
}).stdout.trim(),
);

export const root = {
keypair: rootKeypair,
address: Address.fromString(rootKeypair.publicKey()),
}
};

export const rpcUrl = process.env.SOROBAN_RPC_URL ?? "http://localhost:8000/";
export const networkPassphrase = process.env.SOROBAN_NETWORK_PASSPHRASE ?? "Standalone Network ; February 2017";
export const networkPassphrase =
process.env.SOROBAN_NETWORK_PASSPHRASE ??
"Standalone Network ; February 2017";

export const signer = basicNodeSigner(root.keypair, networkPassphrase);

0 comments on commit e91226f

Please sign in to comment.