-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkeygen_test.go
39 lines (35 loc) · 1.11 KB
/
keygen_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
39
package keygen
import (
"encoding/json"
"fmt"
"os"
"reflect"
"testing"
)
func TestWallets(t *testing.T) {
var testWallets = []Wallet{
GenerateWallet("~doznec-marbud", 1, "", 0, false),
GenerateWallet("~marbud-tidsev-litsut-hidfep", 65012, "", 0, true),
GenerateWallet("~wacfus-dabpex-danted-mosfep-pasrud-lavmer-nodtex-taslus-pactyp-milpub-pildeg-fornev-ralmed-dinfeb-fopbyr-sanbet-sovmyl-dozsut-mogsyx-mapwyc-sorrup-ricnec-marnys-lignex", 222, "froot loops", 6, false),
GenerateWallet("~doznec-marbud", 0, "", 0, false),
GenerateWallet("~doznec-marbud", 0x00ffffff, "", 0, false),
}
for i := 0; i < 5; i++ {
assetWalletData, err := os.ReadFile("assets/wallet" + fmt.Sprint(i) + ".json")
if err != nil {
panic(err)
}
var assetWallet Wallet
err = json.Unmarshal(assetWalletData, &assetWallet)
if err != nil {
panic(err)
}
assetWallet.Meta.Generator = Generator{}
testWallets[i].Meta.Generator = Generator{}
if !reflect.DeepEqual(assetWallet, testWallets[i]) {
t.Error("error at wallet" + fmt.Sprint(i) + ".json")
t.Logf("%#v\n", assetWallet)
t.Logf("%#v\n", testWallets[i])
}
}
}