Skip to content

Commit 8e21301

Browse files
revert unrelated formatting in ts tests
1 parent 4dd685d commit 8e21301

3 files changed

Lines changed: 22 additions & 16 deletions

File tree

cmd/crates/soroban-spec-typescript/ts-tests/src/test-custom-types.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,9 @@ test("tuple", async (t) => {
189189
});
190190

191191
test("option", async (t) => {
192-
// this makes sense
193192
t.deepEqual((await contract.option({ option: 1 })).result, 1);
194193

195-
// this passes but shouldn't
196-
t.deepEqual((await contract.option({ option: undefined })).result, undefined);
194+
t.deepEqual((await contract.option({ option: undefined })).result, null);
197195

198196
// this is the behavior we probably want, but fails
199197
// t.deepEqual(await contract.option(), undefined) // typing and implementation require the object
@@ -221,3 +219,11 @@ test("tuple_strukt", async (t) => {
221219
const res = [{ a: 0, b: true, c: "hello" }, { tag: "First" }];
222220
t.deepEqual((await contract.tuple_strukt({ tuple_strukt: arg })).result, res);
223221
});
222+
223+
test("timepoint", async (t) => {
224+
t.is((await contract.timepoint({ timepoint: 1n })).result, 1n);
225+
});
226+
227+
test("duration", async (t) => {
228+
t.is((await contract.duration({ duration: 1n })).result, 1n);
229+
});
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import test from "ava";
2-
import { rpcUrl, root, signer } from "./util.js";
3-
import { Client, networks } from "test-custom-types";
1+
import test from "ava"
2+
import { rpcUrl, root, signer } from "./util.js"
3+
import { Client, networks } from "test-custom-types"
44

55
const contract = new Client({
66
...networks.local,
77
rpcUrl,
88
allowHttp: true,
99
publicKey: root.keypair.publicKey(),
1010
...signer,
11-
});
11+
})
1212

1313
test("has correctly-typed result", async (t) => {
14-
const initial = await contract.hello({ hello: "tests" });
15-
t.is(initial.result, "tests");
14+
const initial = await contract.hello({ hello: "tests" })
15+
t.is(initial.result, "tests")
1616

17-
const serialized = initial.toJSON();
18-
const deserialized = contract.fromJSON.hello(serialized);
19-
t.is(deserialized.result, "tests"); // throws TS error if `result` is of type `unknown`
17+
const serialized = initial.toJSON()
18+
const deserialized = contract.fromJSON.hello(serialized)
19+
t.is(deserialized.result, "tests") // throws TS error if `result` is of type `unknown`
2020
});

cmd/crates/soroban-spec-typescript/ts-tests/src/test-xlm-lib-from-sac.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import test from "ava";
2-
import { rpcUrl, root, signer } from "./util.js";
3-
import { Client, networks } from "xlm";
1+
import test from "ava"
2+
import { rpcUrl, root, signer } from "./util.js"
3+
import { Client, networks } from "xlm"
44

55
const contract = new Client({
66
...networks.local,
77
rpcUrl,
88
allowHttp: true,
99
publicKey: root.keypair.publicKey(),
1010
...signer,
11-
});
11+
})
1212

1313
test("can generate a lib from a Stellar Asset Contract", async (t) => {
1414
t.is((await contract.symbol()).result, "native");

0 commit comments

Comments
 (0)