-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into rjwebb/update-message-type
- Loading branch information
Showing
12 changed files
with
162 additions
and
99 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
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,34 @@ | ||
import test from "ava" | ||
|
||
import { Canvas } from "@canvas-js/core" | ||
import { PRNGSigner } from "./utils.js" | ||
import { setTimeout } from "timers/promises" | ||
|
||
test("test PRNGSigner", async (t) => { | ||
const app1 = await Canvas.initialize({ | ||
topic: "com.example.app", | ||
contract: { | ||
models: {}, | ||
actions: { hello: () => {} }, | ||
}, | ||
signers: [new PRNGSigner(0)], | ||
}) | ||
|
||
const app2 = await Canvas.initialize({ | ||
topic: "com.example.app", | ||
contract: { | ||
models: {}, | ||
actions: { hello: () => {} }, | ||
}, | ||
signers: [new PRNGSigner(0)], | ||
}) | ||
|
||
for (let i = 0; i < 3; i++) { | ||
await app1.actions.hello() | ||
await setTimeout(10) | ||
await app2.actions.hello() | ||
await setTimeout(10) | ||
} | ||
|
||
t.deepEqual(await app1.db.query("$messages"), await app2.db.query("$messages")) | ||
}) |
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
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
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