Skip to content

Commit

Permalink
Merge branch 'main' into snap
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch authored Jul 30, 2024
2 parents 77bbc12 + 391be3a commit d8d5eb9
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 17 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/bindings-ts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: bindings typescript

on:
push:
branches: [main, release/**]
pull_request:

jobs:
test:
name: test generated libraries
runs-on: ubuntu-22.04
services:
rpc:
image: stellar/quickstart:testing
ports:
- 8000:8000
env:
ENABLE_LOGS: true
NETWORK: local
ENABLE_SOROBAN_RPC: true
options: >-
--health-cmd "curl --no-progress-meter --fail-with-body -X POST \"http://localhost:8000/soroban/rpc\" -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"id\":8675309,\"method\":\"getNetwork\"}' && curl --no-progress-meter \"http://localhost:8000/friendbot\" | grep '\"invalid_field\": \"addr\"'"
--health-interval 10s
--health-timeout 5s
--health-retries 50
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: rustup update
- run: cargo build
- run: rustup target add wasm32-unknown-unknown
- run: make build-test-wasms
- run: npm ci && npm run test
working-directory: cmd/crates/soroban-spec-typescript/ts-tests
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 d8d5eb9

Please sign in to comment.