add coin impl equality operator overrides

This commit is contained in:
sneurlax 2024-04-17 13:04:10 -05:00
parent edc8737edc
commit 12030da1b2
17 changed files with 136 additions and 0 deletions

View file

@ -45,4 +45,12 @@ class Banano extends NanoCurrency {
throw UnimplementedError();
}
}
@override
bool operator ==(Object other) {
return other is Banano && other.network == network;
}
@override
int get hashCode => Object.hash(Banano, network);
}

View file

@ -203,4 +203,12 @@ class Bitcoin extends Bip39HDCurrency with PaynymCurrencyInterface {
throw UnimplementedError();
}
}
@override
bool operator ==(Object other) {
return other is Bitcoin && other.network == network;
}
@override
int get hashCode => Object.hash(Bitcoin, network);
}

View file

@ -72,4 +72,12 @@ class BitcoinFrost extends FrostCurrency {
// TODO: implement validateAddress for frost addresses
return true;
}
@override
bool operator ==(Object other) {
return other is BitcoinFrost && other.network == network;
}
@override
int get hashCode => Object.hash(BitcoinFrost, network);
}

View file

@ -289,4 +289,12 @@ class Bitcoincash extends Bip39HDCurrency {
throw UnimplementedError();
}
}
@override
bool operator ==(Object other) {
return other is Bitcoincash && other.network == network;
}
@override
int get hashCode => Object.hash(Bitcoincash, network);
}

View file

@ -181,4 +181,12 @@ class Dogecoin extends Bip39HDCurrency {
throw UnimplementedError();
}
}
@override
bool operator ==(Object other) {
return other is Dogecoin && other.network == network;
}
@override
int get hashCode => Object.hash(Dogecoin, network);
}

View file

@ -269,4 +269,12 @@ class Ecash extends Bip39HDCurrency {
throw UnimplementedError();
}
}
@override
bool operator ==(Object other) {
return other is Ecash && other.network == network;
}
@override
int get hashCode => Object.hash(Ecash, network);
}

View file

@ -61,4 +61,12 @@ class Epiccash extends Bip39Currency {
throw UnimplementedError();
}
}
@override
bool operator ==(Object other) {
return other is Epiccash && other.network == network;
}
@override
int get hashCode => Object.hash(Epiccash, network);
}

View file

@ -34,4 +34,12 @@ class Ethereum extends Bip39Currency {
bool validateAddress(String address) {
return isValidEthereumAddress(address);
}
@override
bool operator ==(Object other) {
return other is Ethereum && other.network == network;
}
@override
int get hashCode => Object.hash(Ethereum, network);
}

View file

@ -199,4 +199,12 @@ class Firo extends Bip39HDCurrency {
throw UnimplementedError();
}
}
@override
bool operator ==(Object other) {
return other is Firo && other.network == network;
}
@override
int get hashCode => Object.hash(Firo, network);
}

View file

@ -212,4 +212,12 @@ class Litecoin extends Bip39HDCurrency {
throw UnimplementedError();
}
}
@override
bool operator ==(Object other) {
return other is Litecoin && other.network == network;
}
@override
int get hashCode => Object.hash(Litecoin, network);
}

View file

@ -44,4 +44,12 @@ class Monero extends CryptonoteCurrency {
throw UnimplementedError();
}
}
@override
bool operator ==(Object other) {
return other is Monero && other.network == network;
}
@override
int get hashCode => Object.hash(Monero, network);
}

View file

@ -185,4 +185,12 @@ class Namecoin extends Bip39HDCurrency {
return false;
}
}
@override
bool operator ==(Object other) {
return other is Namecoin && other.network == network;
}
@override
int get hashCode => Object.hash(Namecoin, network);
}

View file

@ -45,4 +45,12 @@ class Nano extends NanoCurrency {
throw UnimplementedError();
}
}
@override
bool operator ==(Object other) {
return other is Nano && other.network == network;
}
@override
int get hashCode => Object.hash(Nano, network);
}

View file

@ -165,4 +165,12 @@ class Particl extends Bip39HDCurrency {
return false;
}
}
@override
bool operator ==(Object other) {
return other is Particl && other.network == network;
}
@override
int get hashCode => Object.hash(Particl, network);
}

View file

@ -39,4 +39,12 @@ class Stellar extends Bip39Currency {
@override
bool validateAddress(String address) =>
RegExp(r"^[G][A-Z0-9]{55}$").hasMatch(address);
@override
bool operator ==(Object other) {
return other is Stellar && other.network == network;
}
@override
int get hashCode => Object.hash(Stellar, network);
}

View file

@ -146,4 +146,12 @@ class Tezos extends Bip39Currency {
}
// ===========================================================================
@override
bool operator ==(Object other) {
return other is Tezos && other.network == network;
}
@override
int get hashCode => Object.hash(Tezos, network);
}

View file

@ -44,4 +44,12 @@ class Wownero extends CryptonoteCurrency {
throw UnimplementedError();
}
}
@override
bool operator ==(Object other) {
return other is Wownero && other.network == network;
}
@override
int get hashCode => Object.hash(Wownero, network);
}