-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
While creating the TS Bindings, we were creating a higher level Spec (not just `Vec<ScSpecEntry>`), from the raw bytes of the XDR. This higher-level Spec uses metadata from Wasm files, rather than just the raw `Vec<ScSpecEntry>` stuff, but TS Bindings don't even use that extra metadata. This implementation detail resulted in a bug when generating TS Bindings for Stellar Asset Contracts, which do not have the (unused) extra metadata. This adds a test of generating TS Bindings for SAC, and fixes the bug. We've also cleaned up `ts-tests` logic while here, updating "soroban" references with "stellar".
- Loading branch information
1 parent
7a50b86
commit 1efc4c5
Showing
7 changed files
with
36 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SOROBAN_NETWORK_PASSPHRASE="Standalone Network ; February 2017" | ||
SOROBAN_RPC_URL="http://localhost:8000/soroban/rpc" | ||
SOROBAN_FRIENDBOT_URL="http://localhost:8000/friendbot" | ||
STELLAR_NETWORK_PASSPHRASE="Standalone Network ; February 2017" | ||
STELLAR_RPC_URL="http://localhost:8000/rpc" | ||
STELLAR_FRIENDBOT_URL="http://localhost:8000/friendbot" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
cmd/crates/soroban-spec-typescript/ts-tests/src/test-xlm-lib-from-sac.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import test from "ava" | ||
import { rpcUrl, root, signer } from "./util.js" | ||
import { Client, networks } from "xlm" | ||
|
||
const contract = new Client({ | ||
...networks.standalone, | ||
rpcUrl, | ||
allowHttp: true, | ||
publicKey: root.keypair.publicKey(), | ||
...signer, | ||
}) | ||
|
||
test("can generate a lib from a Stellar Asset Contract", async (t) => { | ||
t.is((await contract.symbol()).result, "native"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters