-
Notifications
You must be signed in to change notification settings - Fork 3
/
crawler_test.go
62 lines (45 loc) · 1017 Bytes
/
crawler_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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package main
import (
"net/url"
"testing"
)
func TestGetHistoricalContracts(t *testing.T) {
_, err := LoadEnv()
if err != nil {
t.Error(err)
}
// ethURL := os.Getenv("ETHEREUM_RPC_URL")
url, err := url.Parse("https://nodes.casimir.co/eth/hardhat")
if err != nil {
t.Error(err)
}
config := Config{
Env: Dev,
URL: url,
Start: 0,
BatchSize: 250_000,
ConcurrencyLimit: 10,
}
crawler, err := NewEthereumCrawler(config)
if err != nil {
t.Error(err)
}
_, err = crawler.GetHistoricalContracts()
if err != nil {
t.Error(err)
}
}
// func TestNewEthereumCrawler(t *testing.T) {
// var err error
// crawler, err := NewEthereumCrawler(Config{Env: Dev})
// if err != nil {
// t.Error(err)
// }
// _, err = crawler.Client.BlockNumber(context.Background())
// if err != nil {
// t.Error(err)
// }
// if crawler.Config.Version == 0 {
// t.Errorf("expected at least version 1, but got %s", crawler.Config.Version)
// }
// }