-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/example app #35
Conversation
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
Report is too large to display inline. Next stepsMark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
66f0010
to
997407d
Compare
997407d
to
c3e9267
Compare
@@ -0,0 +1,3 @@ | |||
[env] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi!
This file should be gitignore
as it is environment specific.
@@ -1,9 +1,7 @@ | |||
/target | |||
**/*.rs.bk | |||
/.vscode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment. .vscode and .cargo should not be part of the repo.
@@ -0,0 +1,7 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
let client = new EsploraClient("https://mutinynet.com/api"); | ||
if (!walletDataString) { | ||
console.log("Creating new wallet"); | ||
wallet = Wallet.create( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this if
would constitute an example test showcasing create
walletDataString = stagedDataString; | ||
} else { | ||
console.log("Loading wallet"); | ||
let changeSet = ChangeSet.from_json(walletDataString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this else
would constitute an example test showcasing load
); | ||
|
||
console.log("Performing Full Scan..."); | ||
let full_scan_request = wallet.start_full_scan(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example to showcase full_scan
using Esplora.
|
||
console.log("Syncing..."); | ||
let sync_request = wallet.start_sync_with_revealed_spks(); | ||
let update = await client.sync(sync_request, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example to showcase sync
using Esplora.
console.log("Update:", updateChangeSet.to_json()); | ||
let currentChangeSet = ChangeSet.from_json(walletDataString); | ||
console.log("Current:", currentChangeSet.to_json()); | ||
currentChangeSet.merge(updateChangeSet); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example of merge
.
console.log("Current:", currentChangeSet.to_json()); | ||
currentChangeSet.merge(updateChangeSet); | ||
console.log("Merged:", currentChangeSet.to_json()); | ||
Store.save(currentChangeSet.to_json()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can drop the Store
IMO but that could be an example of storage, even though I don't see the need for it since the users will get a ChangeSet
an can do with it what they like.
Ok, this should be converted to js tests rather than an app |
Description
Add an example app that is touches on all the wasm specific stuff
(this pr builds on the previous one that just updated the readme)
Notes to the reviewers
Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
Bugfixes: