casper-network / casper-network/casper-node
Inconsistent Bincode Serialization between `casper_node::types::DeployHash` and `casper_types::DeployHash`
- Dominant language
- Rust
- Stars
- 399
- Forks
- 224
- Avg merge
- 15h 44m
- Merged PRs (30d)
- 2
Description
The following unit test fails:
```rust
#[test]
fn deploy_hashes_serialize_differently() {
let casper_types_deploy_hash = casper_types::DeployHash::new([42; 32]);
let casper_node_deploy_hash: casper_node::types::DeployHash =
casper_types_deploy_hash.clone().into();
let serialized_casper_types_deploy_hash =
bincode::serialize(&casper_types_deploy_hash).unwrap();
let serialized_casper_node_deploy_hash =
bincode::serialize(&casper_node_deploy_hash).unwrap();
assert_eq!(
serialized_casper_node_deploy_hash,
serialized_casper_types_deploy_hash
);
}
```
Here is the output:
```
assertion `left == right` failed
left: [32, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42]
right: [42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42]
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.