-
Notifications
You must be signed in to change notification settings - Fork 1
/
auroracoin_test.go
38 lines (35 loc) · 1.44 KB
/
auroracoin_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package crptwav
import "testing"
func TestIsValidAuroracoin(t *testing.T) {
tt := []struct {
currency string
address string
network string
}{
{address: "ARM3GLZXF1PDTZ5vz3wh5MVahbK9BHTWAN", currency: "auroracoin", network: "prod"},
{address: "AUtfc6ThCLb7FuEu7QPrWpJuaXaJRPciDF", currency: "auroracoin", network: "prod"},
{address: "AUN1oaj5hjispGnczt8Aruw3TxgGyRqB3V", currency: "auroracoin", network: "prod"},
{address: "AXGcBkGX6NiaDXj85C5dCrhTRUgwxSkKDK", currency: "auroracoin", network: "prod"},
{address: "AXGcBkGX6NiaDXj85C5dCrhTRUgwxSkKDK", currency: "AUR", network: "prod"},
{address: "mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef", currency: "auroracoin", network: "testnet"},
// p2sh addresses
{address: "3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt", currency: "auroracoin", network: "prod"},
{address: "2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7", currency: "auroracoin", network: "testnet"},
}
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)
}
}
}
}