Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-demox committed Oct 16, 2024
1 parent 3ba455b commit 4ab7f2e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 2 additions & 0 deletions crates/rust-client/src/store/web_store/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Formatting for .js files
Please install the VSCode prettier extension and set as default formatter for js
2 changes: 1 addition & 1 deletion crates/rust-client/src/store/web_store/js/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ db.version(1).stores({
[Table.Accounts]: indexes('[id+nonce]', 'codeRoot', 'storageRoot', 'vaultRoot', 'accountHash'),
[Table.Transactions]: indexes('id'),
[Table.TransactionScripts]: indexes('scriptHash'),
[Table.InputNotes]: indexes('noteId', 'recipient', 'ignored', 'nullifier', 'stateDiscriminant'),
[Table.InputNotes]: indexes('noteId', 'nullifier', 'stateDiscriminant'),
[Table.OutputNotes]: indexes('noteId', 'recipient', 'status', 'importedTag', 'ignored', 'nullifier'),
[Table.NotesScripts]: indexes('scriptHash'),
[Table.StateSync]: indexes('id'),
Expand Down
5 changes: 0 additions & 5 deletions crates/rust-client/src/store/web_store/js/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,6 @@ async function updateCommittedNotes(
for (let i = 0; i < inputNoteIds.length; i++) {
const noteId = inputNoteIds[i];

// Update input notes
await tx.inputNotes.where({ noteId: noteId }).modify({
stateDiscriminant: 2, // STATE_COMMITTED
});

// Remove note tags
await tx.tags.where('source_note_id').equals(noteId).delete();
}
Expand Down
4 changes: 2 additions & 2 deletions crates/rust-client/src/store/web_store/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl WebStore {
.map(|input_note| input_note.id().inner().to_hex())
.collect();

// TODO: LOP INTO idxdb_apply_state_sync call
// TODO: Remove upsert call and refactor input note(s) into idxdb_apply_state_sync call
for input_note in committed_notes.updated_input_notes().iter() {
let inclusion_proof = input_note.proof().ok_or(StoreError::DatabaseError(
"Input note doesn't have inclusion proof".to_string(),
Expand All @@ -192,7 +192,7 @@ impl WebStore {
}
}

// TODO: LOP INTO idxdb_apply_state_sync call
// TODO: Remove upsert call and refactor input note(s) into idxdb_apply_state_sync call
// Commit new public notes
for note in committed_notes.new_public_notes() {
let details = note.note().into();
Expand Down
2 changes: 1 addition & 1 deletion crates/web-client/test/mocha.global.setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ before(async () => {
shell: process.platform == "win32",
});

browser = await puppeteer.launch({ headless: true, protocolTimeout: 600000 });
browser = await puppeteer.launch({ headless: true });
testingPage = await browser.newPage();
await testingPage.goto(TEST_SERVER);

Expand Down

0 comments on commit 4ab7f2e

Please sign in to comment.