Implement testTransition.Equal() for CI
@@ -487,6 +487,26 @@ func (tr *testTransition) BlockInfo() module.BlockInfo {
return tr._bi
}
+func equalBlockInfo(bi1 module.BlockInfo, bi2 module.BlockInfo) bool {
+ if bi1 == nil && bi2 == nil {
+ return true
+ }
+ if bi1 == nil || bi2 == nil {
+ return false
+ }
+ return bi1.Timestamp() == bi2.Timestamp() && bi1.Height() == bi2.Height()
+}
+
+func (tr *testTransition) Equal(t2 module.Transition) bool {
+ tr2 := t2.(*testTransition)
+ if tr == tr2 {
+ return true
+ }
+ return tr.patchTransactions.Equal(tr2.patchTransactions) &&
+ tr.normalTransactions.Equal(tr2.normalTransactions) &&
+ equalBlockInfo(tr._bi, tr2._bi)
+}
+
type testServiceManager struct {
test.ServiceManagerBase
transactions [][]*testTransaction
