-
Notifications
You must be signed in to change notification settings - Fork 1
/
dash_test.go
32 lines (30 loc) · 1.04 KB
/
dash_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
package crptwav
import "testing"
func TestIsValidDash(t *testing.T) {
tt := []struct {
currency string
address string
network string
}{
{address: "Xx4dYKgz3Zcv6kheaqog3fynaKWjbahb6b", currency: "dash", network: "prod"},
{address: "XcY4WJ6Z2Q8w7vcYER1JypC8s2oa3SQ1b1", currency: "DASH", network: "prod"},
{address: "XqMkVUZnqe3w4xvgdZRtZoe7gMitDudGs4", currency: "dash", network: "prod"},
{address: "yPv7h2i8v3dJjfSH4L3x91JSJszjdbsJJA", currency: "dash", 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)
}
}
}
}