Fixed serializiation determinacy problems.
This commit is contained in:
@@ -39,14 +39,14 @@ impl SideNode {
|
||||
let transaction = utils::fake_transaction_json(stdin);
|
||||
let json = serde_json::to_value(transaction).unwrap();
|
||||
let signed_op = self.add_transaction_local(json);
|
||||
println!("STDIN: {}", shappy(signed_op.clone()));
|
||||
println!("STDIN: {}", utils::shappy(signed_op.clone()));
|
||||
self.send_to_network(signed_op).await;
|
||||
}
|
||||
Err(_) => {} // ignore empty channel errors in this PoC
|
||||
}
|
||||
match self.incoming_receiver.try_recv() {
|
||||
Ok(incoming) => {
|
||||
println!("INCOMING");
|
||||
println!("INCOMING: {}", utils::shappy(incoming.clone()));
|
||||
self.handle_incoming(incoming);
|
||||
}
|
||||
Err(_) => {} // ignore empty channel errors in this PoC
|
||||
@@ -60,7 +60,6 @@ impl SideNode {
|
||||
}
|
||||
|
||||
pub fn handle_incoming(&mut self, incoming: SignedOp) {
|
||||
println!("handle_incoming: {}", shappy(incoming.clone()));
|
||||
self.crdt.apply(incoming);
|
||||
// self.trace_crdt();
|
||||
}
|
||||
@@ -95,8 +94,3 @@ impl SideNode {
|
||||
self.crdt.doc.view_sha()
|
||||
}
|
||||
}
|
||||
|
||||
fn shappy(op: SignedOp) -> String {
|
||||
let b = serde_json::to_string(&op).unwrap().into_bytes();
|
||||
sha256::digest(b).to_string()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user