mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 11:59:30 +00:00
add coin impl equality operator overrides
This commit is contained in:
parent
edc8737edc
commit
12030da1b2
17 changed files with 136 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue