cic-go/cic_net/cic_net_test.go
Mohamed Sohail 7731a23e35
update: (cic_net) add new methods and tests (#1)
* update: (cic_net) add new methods and tests

* add: write tx methods and tests

- add ci for testing
- coveralls for coverage

* ci: add test environment

* ci: expose secrets to env

* docs: add badges
2022-05-08 14:13:45 +03:00

33 lines
623 B
Go

package cic_net
import (
"github.com/lmittmann/w3"
"os"
"testing"
)
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
t.Run(name, func(t *testing.T) {
cicnet, _ := NewCicNet(conf.rpcProvider, w3.A(conf.tokenIndex))
if err := cicnet.Close(); (err != nil) != wantErr {
t.Errorf("EntryCount() error = %v, wantErr %v", err, wantErr)
}
})
}