diff --git a/trezorlib/client.py b/trezorlib/client.py index 0b5806c..950d8f9 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -405,9 +405,8 @@ class DebugLinkMixin(object): "Expected %s, got %s" % (pprint(expected), pprint(msg))) for field, value in expected.__dict__.items(): - if getattr(expected, field) is None: + if value is None or value == []: continue - print("EXPECTED", getattr(expected, field), getattr(msg, field), field, value) if getattr(msg, field) != value: raise CallException(proto.FailureType.UnexpectedMessage, "Expected %s, got %s" % (pprint(expected), pprint(msg))) diff --git a/trezorlib/protobuf.py b/trezorlib/protobuf.py index d367556..096fb66 100644 --- a/trezorlib/protobuf.py +++ b/trezorlib/protobuf.py @@ -102,7 +102,12 @@ class MessageType: self.__dict__ == rhs.__dict__) def __repr__(self): - return '<%s: %s>' % (self.__class__.__name__, self.__dict__) + d = {} + for key, value in self.__dict__.items(): + if value is None or value == []: + continue + d[key] = value + return '<%s: %s>' % (self.__class__.__name__, d) def __iter__(self): return self.__dict__.__iter__()