[bug] ProcessState compute_modified_fields compare hashes instead of ciphers
This commit is contained in:
parent
00327b2e46
commit
d19abaf653
@ -32,7 +32,7 @@ impl ProcessState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn compute_modified_fields(&self, previous_state: Option<&ProcessState>) -> Vec<String> {
|
fn compute_modified_fields(&self, previous_state: Option<&ProcessState>) -> Vec<String> {
|
||||||
let new_state = &self.encrypted_pcd;
|
let new_state = &self.pcd_commitment;
|
||||||
|
|
||||||
// Ensure the new state is a JSON object
|
// Ensure the new state is a JSON object
|
||||||
let new_state_obj = new_state
|
let new_state_obj = new_state
|
||||||
@ -42,7 +42,7 @@ impl ProcessState {
|
|||||||
if let Some(prev_state) = previous_state {
|
if let Some(prev_state) = previous_state {
|
||||||
// Previous state exists; compute differences
|
// Previous state exists; compute differences
|
||||||
let previous_state_obj = prev_state
|
let previous_state_obj = prev_state
|
||||||
.encrypted_pcd
|
.pcd_commitment
|
||||||
.as_object()
|
.as_object()
|
||||||
.expect("Previous state should be a JSON object");
|
.expect("Previous state should be a JSON object");
|
||||||
|
|
||||||
@ -288,7 +288,6 @@ impl Process {
|
|||||||
let mut previous_commited_in = OutPoint::null();
|
let mut previous_commited_in = OutPoint::null();
|
||||||
// We iterate backwards until we find a state that has a different commited_in
|
// We iterate backwards until we find a state that has a different commited_in
|
||||||
for state in self.states.iter().rev() {
|
for state in self.states.iter().rev() {
|
||||||
log::debug!("state: {:#?}", state);
|
|
||||||
if previous_commited_in == OutPoint::null() {
|
if previous_commited_in == OutPoint::null() {
|
||||||
previous_commited_in = state.commited_in;
|
previous_commited_in = state.commited_in;
|
||||||
} else if previous_commited_in != state.commited_in {
|
} else if previous_commited_in != state.commited_in {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user