mirror of
https://github.com/grassrootseconomics/cic-go.git
synced 2024-11-23 22:26:46 +01:00
Mohammed Sohail
c34e1444dc
changes to contract: - returns 0 instead of false error status - func return type is []big.Int
34 lines
614 B
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)
|
|
}
|
|
})
|
|
}
|