Current deserealization of InputNoteCommitment from its proto counterpart involves a middle step of converting the inner fields to bytes, then build from_bytes:
|
// TODO: https://github.com/0xMiden/node/issues/1783 |
|
// InputNoteCommitment has private fields, so we reconstruct it via |
|
// serialization roundtrip using its Serializable/Deserializable impls. |
|
let mut bytes = Vec::new(); |
|
nullifier.write_into(&mut bytes); |
|
header.write_into(&mut bytes); |
|
InputNoteCommitment::read_from_bytes(&bytes) |
|
.map_err(|err| ConversionError::deserialization_error("InputNoteCommitment", err)) |
|
} |
After 0xMiden/protocol#2588 we should be able to remove the serialization middle step, and replace the instantiation of the type with from_parts_unchecked().
Original discussion
Current deserealization of
InputNoteCommitmentfrom its proto counterpart involves a middle step of converting the inner fields to bytes, then buildfrom_bytes:node/crates/proto/src/domain/transaction.rs
Lines 88 to 96 in a287a5a
After 0xMiden/protocol#2588 we should be able to remove the serialization middle step, and replace the instantiation of the type with
from_parts_unchecked().Original discussion