diff --git a/src/services/database.service.ts b/src/services/database.service.ts index f228297..e61f959 100755 --- a/src/services/database.service.ts +++ b/src/services/database.service.ts @@ -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 } }, ], diff --git a/src/services/service.ts b/src/services/service.ts index 29371c2..ec3769b 100755 --- a/src/services/service.ts +++ b/src/services/service.ts @@ -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) {