deals: cleanup client state machine

This commit is contained in:
Łukasz Magiera
2019-11-07 14:29:43 +01:00
parent 79c9fb719e
commit 8ec37e8728
4 changed files with 117 additions and 43 deletions
+12
View File
@@ -66,3 +66,15 @@ func AsIpld(obj interface{}) (ipld.Node, error) {
}
return cbor.WrapObject(obj, math.MaxUint64, -1)
}
func Equals(a cbg.CBORMarshaler, b cbg.CBORMarshaler) (bool, error) {
ab, err := Dump(a)
if err != nil {
return false, err
}
bb, err := Dump(b)
if err != nil {
return false, err
}
return bytes.Equal(ab, bb), nil
}