Replace byMerkleRoot index by byStateId for AnkPendingDiff

This commit is contained in:
NicolasCantu 2025-01-15 14:34:55 +01:00
parent bd039ee238
commit da74539b03
2 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ class Database {
name: 'diffs',
options: { keyPath: 'value_commitment' },
indices: [
{ name: 'byMerkleRoot', keyPath: 'new_state_merkle_root', options: { unique: false } },
{ name: 'byStateId', keyPath: 'state_id', options: { unique: false } },
{ name: 'byNeedValidation', keyPath: 'need_validation', options: { unique: false } },
{ name: 'byStatus', keyPath: 'validation_status', options: { unique: false } },
],

View File

@ -580,7 +580,7 @@ export default class Services {
if (updatedProcess.new_diffs.length != 0) {
const [updatedDiffs, retrievedValues] = await this.tryFetchDiffValue(updatedProcess.new_diffs);
if (Object.entries(retrievedValues).length != 0) {
const stateId = updatedDiffs[0].new_state_merkle_root;
const stateId = updatedDiffs[0].state_id;
const processId = updatedDiffs[0].process_id;
// We update the process with the value we retrieved
const hashToValues = JSON.stringify(retrievedValues);
@ -622,7 +622,7 @@ export default class Services {
throw new Error('Pairing process must have roles');
}
const processId = rolesDiff.process_id;
const stateId = rolesDiff.new_state_merkle_root;
const stateId = rolesDiff.state_id;
try {
await this.routingInstance.openPairingConfirmationModal(rolesDiff.new_value, processId, stateId);
} catch (e) {