|
2 | 2 | // MainPod |
3 | 3 | // |
4 | 4 |
|
5 | | -use std::{fmt, iter}; |
| 5 | +use std::{any::Any, fmt, iter}; |
6 | 6 |
|
7 | 7 | use itertools::Itertools; |
8 | 8 | use serde::{Deserialize, Serialize}; |
@@ -56,6 +56,21 @@ pub struct MockMainPod { |
56 | 56 | merkle_proofs_containers: Vec<MerkleClaimAndProof>, |
57 | 57 | } |
58 | 58 |
|
| 59 | +impl PartialEq for MockMainPod { |
| 60 | + fn eq(&self, other: &Self) -> bool { |
| 61 | + self.params == other.params |
| 62 | + && self.id == other.id |
| 63 | + && self.vd_set == other.vd_set |
| 64 | + && self.input_signed_pods == other.input_signed_pods |
| 65 | + && self.input_recursive_pods == other.input_recursive_pods |
| 66 | + && self.statements == other.statements |
| 67 | + && self.operations == other.operations |
| 68 | + && self.public_statements == other.public_statements |
| 69 | + && self.merkle_proofs_containers == other.merkle_proofs_containers |
| 70 | + } |
| 71 | +} |
| 72 | +impl Eq for MockMainPod {} |
| 73 | + |
59 | 74 | impl fmt::Display for MockMainPod { |
60 | 75 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
61 | 76 | writeln!(f, "MockMainPod ({}):", self.id)?; |
@@ -365,6 +380,17 @@ impl Pod for MockMainPod { |
365 | 380 | }) |
366 | 381 | .expect("serialization to json") |
367 | 382 | } |
| 383 | + |
| 384 | + fn as_any(&self) -> &dyn Any { |
| 385 | + self |
| 386 | + } |
| 387 | + fn equals(&self, other: &dyn Pod) -> bool { |
| 388 | + if let Some(other) = other.as_any().downcast_ref::<MockMainPod>() { |
| 389 | + self == other |
| 390 | + } else { |
| 391 | + false |
| 392 | + } |
| 393 | + } |
368 | 394 | } |
369 | 395 |
|
370 | 396 | impl RecursivePod for MockMainPod { |
|
0 commit comments