forked from erigontech/erigon-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 2
/
embed_test.go
47 lines (44 loc) · 1011 Bytes
/
embed_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
40
41
42
43
44
45
46
47
package snapshothashes
import (
"context"
"testing"
)
func TestFetchSnapshotHashes(t *testing.T) {
dat, err := fetchSnapshotHashes(context.Background(), "https://raw.githubusercontent.com/node-real/bsc-erigon-snapshot/main/mainnet.toml")
if err != nil {
t.Errorf("fetchSnapshotHashes() failed: %v", err)
}
if len(dat) == 0 {
t.Errorf("fetchSnapshotHashes() failed: empty data")
}
}
func TestFetchSnapshotHashesAll(t *testing.T) {
ok, err := LoadSnapshots(context.Background())
if err != nil {
t.Errorf("LoadSnapshots() failed %s", err)
}
if !ok {
t.Errorf("LoadSnapshots() failed")
}
if len(Mainnet) == 0 {
t.Errorf("Mainnet is empty")
}
if len(Sepolia) == 0 {
t.Errorf("Sepolia is empty")
}
if len(Amoy) == 0 {
t.Errorf("Amoy is empty")
}
if len(BorMainnet) == 0 {
t.Errorf("BorMainnet is empty")
}
if len(Gnosis) == 0 {
t.Errorf("Gnosis is empty")
}
if len(Chiado) == 0 {
t.Errorf("Chiado is empty")
}
if len(Holesky) == 0 {
t.Errorf("Holesky is empty")
}
}