From a99ccbc4d287056f914ce5d2b6d8b4aec911d874 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 22 May 2019 16:59:06 +0200 Subject: [PATCH] core: add equality function to coininfo --- core/src/apps/common/coininfo.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/apps/common/coininfo.py b/core/src/apps/common/coininfo.py index 07df82fae..118a68149 100644 --- a/core/src/apps/common/coininfo.py +++ b/core/src/apps/common/coininfo.py @@ -63,6 +63,11 @@ class CoinInfo: self.sign_hash_double = True self.script_hash = sha256_ripemd160_digest + def __eq__(self, other): + if not isinstance(other, CoinInfo): + return NotImplemented + return self.coin_name == other.coin_name + # fmt: off def by_name(name: str) -> CoinInfo: