-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e17da4
commit e83e430
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package crptwav | ||
|
||
import "testing" | ||
|
||
func TestIsValidBitcoinGold(t *testing.T) { | ||
tt := []struct { | ||
currency string | ||
address string | ||
network string | ||
}{ | ||
{address: "GW3JrQyHtoVfEFES3Y9JagiX3VSKQStLwj", currency: "bitcoingold", network: "prod"}, | ||
{address: "GUDWdeMyAXQbrNFFivAhkJQ1GfBCFdc7JF", currency: "bitcoingold", network: "prod"}, | ||
{address: "mvww6DEJ18dbyQUukpVQXvLgrNDJazZn1Y", currency: "bitcoingold", network: "testnet"}, | ||
{address: "mn3mdEE6cf1snxVsknNz4GRTdSrWXqYp7c", currency: "BTG", network: "testnet"}, | ||
{address: "GSNFPRsdaM3MXrU5HW1AxgFwmUQC8HXK9F", currency: "BTG", network: "prod"}, | ||
} | ||
for _, tc := range tt { | ||
switch tc.network { | ||
case NetworkProd: | ||
if !IsValidProdAddress(tc.address, tc.currency) { | ||
t.Errorf("Address %s should be valid %s %s address", tc.address, tc.currency, tc.network) | ||
} | ||
case NetworkTest: | ||
if !IsValidTestnetAddress(tc.address, tc.currency) { | ||
t.Errorf("Address %s should be valid %s %s address", tc.address, tc.currency, tc.network) | ||
} | ||
default: | ||
if !IsValidAddress(tc.address, tc.currency) { | ||
t.Errorf("Address %s should be valid %s %s address", tc.address, tc.currency, tc.network) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters