-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathverify_test.go
More file actions
75 lines (67 loc) · 1.27 KB
/
verify_test.go
File metadata and controls
75 lines (67 loc) · 1.27 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
package etherscanAPI
import (
"fmt"
"testing"
)
func TestGetSource(t *testing.T) {
code, err := GetSourceCode("0xba2184520A1cC49a6159c57e61E1844E085615B6", "")
if err != nil {
t.Error(err)
t.Fail()
}
fmt.Println(code[:6])
if code[:6] != "pragma" {
t.Error(err)
fmt.Println("[" + code + "]")
t.Fail()
}
}
func TestABI(t *testing.T) {
code, err := GetABI("0xba2184520A1cC49a6159c57e61E1844E085615B6", "")
if err != nil {
t.Error(err)
t.Fail()
}
fmt.Println(code[:6])
if code[:1] != "[" {
t.Error(err)
fmt.Println("[" + code + "]")
t.Fail()
}
}
func TestVersion(t *testing.T) {
ver, err := GetVersion("0xba2184520A1cC49a6159c57e61E1844E085615B6", "")
fmt.Println(ver)
if err != nil {
t.Error(err)
t.Fail()
}
if len(ver) < 5 {
t.Error("Wrong Result : " + ver)
t.Fail()
}
}
func TestOptimisation(t *testing.T) {
opt, err := GetOptimisation("0xba2184520A1cC49a6159c57e61E1844E085615B6", "")
fmt.Println(opt)
if err != nil {
t.Error(err)
t.Fail()
}
if !opt {
t.Error("Wrong Result : false")
t.Fail()
}
}
func TestSwarm(t *testing.T) {
ver, err := GetSWARM("0xba2184520A1cC49a6159c57e61E1844E085615B6", "")
fmt.Println(ver)
if err != nil {
t.Error(err)
t.Fail()
}
if len(ver) < 5 {
t.Error("Wrong Result : " + ver)
t.Fail()
}
}