-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathipc_test.go
More file actions
51 lines (44 loc) · 970 Bytes
/
ipc_test.go
File metadata and controls
51 lines (44 loc) · 970 Bytes
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
package ether_go
import (
"testing"
"github.com/DaveAppleton/ether_go/ethIpc"
)
func TestNew(t *testing.T) {
myEipc := ethIpc.NewEthIpc()
if myEipc == nil {
t.Error("Either geth is not running or we cannot initialise")
t.Fail()
}
}
func TestCall(t *testing.T) {
var reply string
var params []interface{}
myEipc := ethIpc.NewEthIpc()
if myEipc == nil {
t.Error("cannot create")
t.Fail()
}
if myEipc.Call("net_version", params, &reply) != nil {
t.Error("Cannot get net version")
t.Fail()
}
if reply != "2" {
t.Error("net version != 2")
t.Fail()
}
t.Log("reply : ", reply)
}
func TestGetTx(t *testing.T) {
var reply interface{}
params := "0x00fee8db65cf6d45bd874d1184e9036b1bc178c7d509dde40a23ad7bafd64b20"
myEipc := ethIpc.NewEthIpc()
if myEipc == nil {
t.Error("cannot create")
t.Fail()
}
if myEipc.Call("eth_getTransactionReceipt", params, &reply) != nil {
t.Error("Cannot get Tx Receipt")
t.Fail()
}
t.Log(reply)
}