Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
keppel committed Oct 26, 2023
1 parent 0478f1c commit 088e2bb
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 55 deletions.
4 changes: 2 additions & 2 deletions src/merk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,8 @@ mod test {
assert_eq!(
merk.root_hash(),
[
140, 163, 149, 233, 94, 254, 203, 18, 92, 37, 170, 106, 170, 123, 117, 219, 215,
111, 135, 151, 92, 88, 253, 233, 75, 20, 98, 248, 128, 8, 222, 30
29, 99, 91, 248, 54, 96, 47, 252, 39, 203, 208, 163, 199, 30, 34, 251, 247, 34,
241, 203, 17, 252, 127, 44, 155, 83, 22, 54, 117, 85, 252, 200
]
);
}
Expand Down
8 changes: 4 additions & 4 deletions src/proofs/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ mod tests {
let chunk = verify_leaf(
ops,
[
89, 129, 189, 87, 229, 178, 155, 195, 54, 144, 248, 243, 103, 71, 228, 172, 163,
193, 94, 87, 248, 34, 10, 83, 141, 28, 237, 227, 247, 25, 158, 145,
222, 93, 128, 149, 117, 136, 34, 175, 204, 82, 228, 113, 242, 144, 152, 190, 210,
27, 195, 34, 24, 196, 210, 99, 250, 119, 219, 114, 52, 167, 191, 249,
],
)
.unwrap();
Expand All @@ -456,8 +456,8 @@ mod tests {
let chunk = verify_leaf(
ops,
[
106, 189, 157, 182, 120, 31, 131, 28, 104, 107, 209, 63, 201, 238, 48, 3, 138, 53,
77, 178, 18, 138, 222, 194, 247, 8, 33, 2, 193, 180, 237, 173,
128, 158, 92, 80, 118, 253, 48, 241, 74, 154, 213, 187, 92, 243, 154, 28, 164, 235,
156, 122, 174, 226, 84, 170, 233, 166, 27, 79, 100, 10, 88, 184,
],
)
.unwrap();
Expand Down
90 changes: 45 additions & 45 deletions src/proofs/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,8 @@ mod test {
encode_into(proof.iter(), &mut bytes);

let expected_hash = [
210, 251, 153, 236, 163, 232, 221, 236, 145, 128, 56, 36, 89, 114, 19, 225, 56, 160,
53, 63, 222, 201, 218, 28, 114, 241, 63, 41, 63, 93, 119, 189,
185, 181, 28, 21, 108, 13, 202, 48, 129, 184, 3, 8, 157, 78, 213, 241, 94, 200, 205,
95, 179, 177, 195, 177, 216, 233, 164, 73, 102, 32, 141, 37,
];

let mut query = Query::new();
Expand Down Expand Up @@ -583,8 +583,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
218, 87, 59, 46, 181, 250, 196, 81, 201, 130, 112, 225, 149, 163, 111, 96, 187, 10,
253, 72, 152, 249, 133, 124, 74, 85, 119, 216, 3, 51, 85, 23
203, 210, 184, 52, 29, 56, 76, 7, 155, 239, 81, 16, 54, 13, 106, 27, 44, 218, 198,
245, 203, 189, 15, 203, 55, 184, 75, 146, 127, 38, 143, 214
])))
);
assert_eq!(
Expand All @@ -598,8 +598,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
157, 106, 215, 69, 200, 37, 192, 49, 179, 191, 192, 216, 235, 226, 168, 238, 86,
46, 126, 85, 209, 214, 128, 228, 162, 15, 20, 64, 234, 242, 215, 198
219, 24, 98, 131, 160, 47, 139, 94, 223, 118, 217, 187, 42, 215, 213, 101, 213,
225, 169, 57, 224, 210, 17, 135, 220, 63, 160, 42, 148, 0, 121, 115
])))
);
assert_eq!(iter.next(), Some(&Op::Child));
Expand Down Expand Up @@ -627,17 +627,17 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
218, 87, 59, 46, 181, 250, 196, 81, 201, 130, 112, 225, 149, 163, 111, 96, 187, 10,
253, 72, 152, 249, 133, 124, 74, 85, 119, 216, 3, 51, 85, 23
203, 210, 184, 52, 29, 56, 76, 7, 155, 239, 81, 16, 54, 13, 106, 27, 44, 218, 198,
245, 203, 189, 15, 203, 55, 184, 75, 146, 127, 38, 143, 214
])))
);
assert_eq!(iter.next(), Some(&Op::Push(Node::KV(vec![5], vec![5]))));
assert_eq!(iter.next(), Some(&Op::Parent));
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
157, 106, 215, 69, 200, 37, 192, 49, 179, 191, 192, 216, 235, 226, 168, 238, 86,
46, 126, 85, 209, 214, 128, 228, 162, 15, 20, 64, 234, 242, 215, 198
219, 24, 98, 131, 160, 47, 139, 94, 223, 118, 217, 187, 42, 215, 213, 101, 213,
225, 169, 57, 224, 210, 17, 135, 220, 63, 160, 42, 148, 0, 121, 115
])))
);
assert_eq!(iter.next(), Some(&Op::Child));
Expand Down Expand Up @@ -678,8 +678,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
157, 106, 215, 69, 200, 37, 192, 49, 179, 191, 192, 216, 235, 226, 168, 238, 86,
46, 126, 85, 209, 214, 128, 228, 162, 15, 20, 64, 234, 242, 215, 198
219, 24, 98, 131, 160, 47, 139, 94, 223, 118, 217, 187, 42, 215, 213, 101, 213,
225, 169, 57, 224, 210, 17, 135, 220, 63, 160, 42, 148, 0, 121, 115
])))
);
assert_eq!(iter.next(), Some(&Op::Child));
Expand Down Expand Up @@ -784,8 +784,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
218, 87, 59, 46, 181, 250, 196, 81, 201, 130, 112, 225, 149, 163, 111, 96, 187, 10,
253, 72, 152, 249, 133, 124, 74, 85, 119, 216, 3, 51, 85, 23
203, 210, 184, 52, 29, 56, 76, 7, 155, 239, 81, 16, 54, 13, 106, 27, 44, 218, 198,
245, 203, 189, 15, 203, 55, 184, 75, 146, 127, 38, 143, 214
])))
);
assert_eq!(
Expand Down Expand Up @@ -826,8 +826,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
218, 87, 59, 46, 181, 250, 196, 81, 201, 130, 112, 225, 149, 163, 111, 96, 187, 10,
253, 72, 152, 249, 133, 124, 74, 85, 119, 216, 3, 51, 85, 23
203, 210, 184, 52, 29, 56, 76, 7, 155, 239, 81, 16, 54, 13, 106, 27, 44, 218, 198,
245, 203, 189, 15, 203, 55, 184, 75, 146, 127, 38, 143, 214
])))
);
assert_eq!(iter.next(), Some(&Op::Push(Node::KV(vec![5], vec![5]))));
Expand Down Expand Up @@ -919,8 +919,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
180, 78, 218, 181, 40, 119, 102, 2, 245, 248, 164, 64, 124, 48, 21, 3, 44, 73, 17,
3, 131, 188, 171, 103, 58, 72, 20, 73, 155, 137, 46, 88
148, 241, 151, 144, 247, 220, 92, 79, 70, 252, 168, 222, 27, 218, 53, 156, 0, 136,
161, 107, 83, 78, 150, 246, 51, 230, 164, 248, 17, 30, 147, 91
])))
);
assert_eq!(iter.next(), Some(&Op::Child));
Expand All @@ -934,9 +934,9 @@ mod test {
vec![
3, 1, 1, 0, 1, 1, 3, 1, 2, 0, 1, 2, 16, 3, 1, 3, 0, 1, 3, 3, 1, 4, 0, 1, 4, 16, 17,
2, 169, 4, 73, 65, 62, 49, 160, 159, 37, 166, 195, 249, 63, 31, 23, 11, 169, 0, 24,
104, 179, 211, 218, 38, 108, 129, 117, 232, 65, 101, 194, 157, 16, 1, 180, 78, 218,
181, 40, 119, 102, 2, 245, 248, 164, 64, 124, 48, 21, 3, 44, 73, 17, 3, 131, 188,
171, 103, 58, 72, 20, 73, 155, 137, 46, 88, 17
104, 179, 211, 218, 38, 108, 129, 117, 232, 65, 101, 194, 157, 16, 1, 148, 241,
151, 144, 247, 220, 92, 79, 70, 252, 168, 222, 27, 218, 53, 156, 0, 136, 161, 107,
83, 78, 150, 246, 51, 230, 164, 248, 17, 30, 147, 91, 17
]
);

Expand Down Expand Up @@ -1040,8 +1040,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
15, 172, 198, 205, 200, 229, 61, 211, 164, 58, 222, 10, 226, 47, 87, 80, 30, 147,
173, 69, 105, 61, 25, 156, 24, 57, 223, 170, 128, 100, 17, 32
131, 182, 249, 107, 5, 43, 253, 172, 175, 5, 92, 100, 112, 7, 61, 179, 216, 127,
180, 104, 127, 239, 76, 175, 20, 208, 82, 101, 163, 177, 107, 229
])))
);
assert_eq!(
Expand All @@ -1055,8 +1055,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
75, 196, 124, 123, 163, 233, 227, 122, 74, 21, 58, 149, 104, 157, 164, 30, 51, 247,
161, 209, 49, 51, 66, 219, 24, 35, 163, 64, 127, 116, 182, 92
71, 142, 184, 184, 188, 130, 2, 241, 17, 17, 179, 82, 112, 27, 31, 20, 92, 69, 145,
176, 112, 235, 30, 16, 54, 157, 64, 114, 154, 54, 63, 253
])))
);
assert_eq!(
Expand Down Expand Up @@ -1086,8 +1086,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
100, 103, 182, 36, 209, 104, 156, 135, 222, 97, 55, 87, 142, 199, 255, 98, 88, 151,
140, 201, 243, 181, 239, 121, 37, 81, 83, 252, 217, 161, 111, 67
150, 100, 68, 82, 53, 2, 5, 199, 230, 152, 77, 216, 114, 30, 205, 210, 226, 140,
161, 62, 235, 10, 116, 142, 115, 201, 56, 218, 44, 151, 86, 154
])))
);
assert_eq!(iter.next(), Some(&Op::Child));
Expand Down Expand Up @@ -1127,8 +1127,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
15, 172, 198, 205, 200, 229, 61, 211, 164, 58, 222, 10, 226, 47, 87, 80, 30, 147,
173, 69, 105, 61, 25, 156, 24, 57, 223, 170, 128, 100, 17, 32
131, 182, 249, 107, 5, 43, 253, 172, 175, 5, 92, 100, 112, 7, 61, 179, 216, 127,
180, 104, 127, 239, 76, 175, 20, 208, 82, 101, 163, 177, 107, 229
])))
);
assert_eq!(
Expand All @@ -1142,8 +1142,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
75, 196, 124, 123, 163, 233, 227, 122, 74, 21, 58, 149, 104, 157, 164, 30, 51, 247,
161, 209, 49, 51, 66, 219, 24, 35, 163, 64, 127, 116, 182, 92
71, 142, 184, 184, 188, 130, 2, 241, 17, 17, 179, 82, 112, 27, 31, 20, 92, 69, 145,
176, 112, 235, 30, 16, 54, 157, 64, 114, 154, 54, 63, 253
])))
);
assert_eq!(
Expand Down Expand Up @@ -1173,8 +1173,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
100, 103, 182, 36, 209, 104, 156, 135, 222, 97, 55, 87, 142, 199, 255, 98, 88, 151,
140, 201, 243, 181, 239, 121, 37, 81, 83, 252, 217, 161, 111, 67
150, 100, 68, 82, 53, 2, 5, 199, 230, 152, 77, 216, 114, 30, 205, 210, 226, 140,
161, 62, 235, 10, 116, 142, 115, 201, 56, 218, 44, 151, 86, 154
])))
);
assert_eq!(iter.next(), Some(&Op::Child));
Expand Down Expand Up @@ -1215,8 +1215,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
15, 172, 198, 205, 200, 229, 61, 211, 164, 58, 222, 10, 226, 47, 87, 80, 30, 147,
173, 69, 105, 61, 25, 156, 24, 57, 223, 170, 128, 100, 17, 32
131, 182, 249, 107, 5, 43, 253, 172, 175, 5, 92, 100, 112, 7, 61, 179, 216, 127,
180, 104, 127, 239, 76, 175, 20, 208, 82, 101, 163, 177, 107, 229
])))
);
assert_eq!(
Expand All @@ -1230,8 +1230,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
75, 196, 124, 123, 163, 233, 227, 122, 74, 21, 58, 149, 104, 157, 164, 30, 51, 247,
161, 209, 49, 51, 66, 219, 24, 35, 163, 64, 127, 116, 182, 92
71, 142, 184, 184, 188, 130, 2, 241, 17, 17, 179, 82, 112, 27, 31, 20, 92, 69, 145,
176, 112, 235, 30, 16, 54, 157, 64, 114, 154, 54, 63, 253
])))
);
assert_eq!(
Expand Down Expand Up @@ -1261,8 +1261,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
100, 103, 182, 36, 209, 104, 156, 135, 222, 97, 55, 87, 142, 199, 255, 98, 88, 151,
140, 201, 243, 181, 239, 121, 37, 81, 83, 252, 217, 161, 111, 67
150, 100, 68, 82, 53, 2, 5, 199, 230, 152, 77, 216, 114, 30, 205, 210, 226, 140,
161, 62, 235, 10, 116, 142, 115, 201, 56, 218, 44, 151, 86, 154
])))
);
assert_eq!(iter.next(), Some(&Op::Child));
Expand Down Expand Up @@ -1303,8 +1303,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
15, 172, 198, 205, 200, 229, 61, 211, 164, 58, 222, 10, 226, 47, 87, 80, 30, 147,
173, 69, 105, 61, 25, 156, 24, 57, 223, 170, 128, 100, 17, 32
131, 182, 249, 107, 5, 43, 253, 172, 175, 5, 92, 100, 112, 7, 61, 179, 216, 127,
180, 104, 127, 239, 76, 175, 20, 208, 82, 101, 163, 177, 107, 229
])))
);
assert_eq!(
Expand All @@ -1318,8 +1318,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
75, 196, 124, 123, 163, 233, 227, 122, 74, 21, 58, 149, 104, 157, 164, 30, 51, 247,
161, 209, 49, 51, 66, 219, 24, 35, 163, 64, 127, 116, 182, 92
71, 142, 184, 184, 188, 130, 2, 241, 17, 17, 179, 82, 112, 27, 31, 20, 92, 69, 145,
176, 112, 235, 30, 16, 54, 157, 64, 114, 154, 54, 63, 253
])))
);
assert_eq!(
Expand Down Expand Up @@ -1349,8 +1349,8 @@ mod test {
assert_eq!(
iter.next(),
Some(&Op::Push(Node::Hash([
100, 103, 182, 36, 209, 104, 156, 135, 222, 97, 55, 87, 142, 199, 255, 98, 88, 151,
140, 201, 243, 181, 239, 121, 37, 81, 83, 252, 217, 161, 111, 67
150, 100, 68, 82, 53, 2, 5, 199, 230, 152, 77, 216, 114, 30, 205, 210, 226, 140,
161, 62, 235, 10, 116, 142, 115, 201, 56, 218, 44, 151, 86, 154
])))
);
assert_eq!(iter.next(), Some(&Op::Child));
Expand Down
8 changes: 4 additions & 4 deletions src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ mod test {
assert_eq!(
tree.child_hash(true),
&[
114, 93, 76, 193, 9, 87, 168, 251, 191, 152, 173, 130, 33, 46, 251, 13, 179, 15,
209, 218, 113, 72, 118, 83, 206, 100, 36, 49, 156, 239, 102, 205
130, 215, 14, 92, 6, 226, 203, 67, 180, 206, 170, 81, 142, 77, 62, 33, 146, 78, 29,
252, 100, 149, 207, 172, 89, 254, 96, 166, 159, 49, 169, 106
]
);
assert_eq!(tree.child_hash(false), &NULL_HASH);
Expand All @@ -554,8 +554,8 @@ mod test {
assert_eq!(
tree.hash(),
[
36, 100, 183, 19, 15, 225, 83, 239, 215, 167, 216, 53, 52, 30, 234, 176, 74, 197,
161, 7, 102, 226, 181, 251, 145, 100, 74, 179, 253, 222, 183, 117
115, 223, 9, 212, 135, 4, 223, 163, 244, 126, 25, 190, 255, 217, 132, 76, 219, 149,
151, 237, 164, 103, 67, 44, 196, 177, 227, 195, 217, 146, 156, 86
]
);
Ok(())
Expand Down

0 comments on commit 088e2bb

Please sign in to comment.