Fixed test race conditions

This commit is contained in:
Ryan O'Hara-Reid
2017-07-26 11:54:53 +10:00
committed by Adrian Gallagher
parent 745505a33e
commit 3e4fb1660d
19 changed files with 251 additions and 102 deletions

View File

@@ -200,13 +200,14 @@ func IsEnabled(isEnabled bool) string {
}
// IsValidCryptoAddress validates your cryptocurrency address string using the
// regexp package
// regexp package // Validation issues occuring because "3" is contained in
// litecoin and Bitcoin addresses - non-fatal
func IsValidCryptoAddress(address, crypto string) (bool, error) {
switch StringToLower(crypto) {
case "btc":
return regexp.MatchString("^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$", address)
case "ltc":
return regexp.MatchString("^[L3][a-km-zA-HJ-NP-Z1-9]{25,34}$", address)
return regexp.MatchString("^[L3M][a-km-zA-HJ-NP-Z1-9]{25,34}$", address)
case "eth":
return regexp.MatchString("^0x[a-km-z0-9]{40}$", address)
default: