cic-go/net/cic_net_test.go
Mohammed Sohail c34e1444dc
add: implement and test
changes to contract:
- returns 0 instead of false error status
- func return type is []big.Int
2022-05-17 16:06:19 +03:00

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)
}
})
}