cic-go/net/cic_net_test.go

34 lines
614 B
Go

package net
import (
"os"
"testing"
"github.com/lmittmann/w3"
)
type tConfig struct {
rpcProvider string
tokenIndex string
privateKey string
}
var conf = &tConfig{
rpcProvider: os.Getenv("RPC_PROVIDER"),
tokenIndex: os.Getenv("TOKEN_INDEX"),
privateKey: os.Getenv("PRIVATE_KEY"),
}
func TestCicNet_Connect(t *testing.T) {
name := "Test RPC connection"
wantErr := false
cicnet, _ := NewCicNet(conf.rpcProvider, w3.A(conf.tokenIndex))
t.Run(name, func(t *testing.T) {
if err := cicnet.Close(); (err != nil) != wantErr {
t.Errorf("Error() error = %v, wantErr %v", err, wantErr)
}
})
}