2022-05-17 15:06:19 +02:00
|
|
|
package balance
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/lmittmann/w3"
|
|
|
|
)
|
|
|
|
|
|
|
|
type tConfig struct {
|
|
|
|
rpcProvider string
|
|
|
|
batchContract string
|
|
|
|
}
|
|
|
|
|
|
|
|
var conf = &tConfig{
|
|
|
|
rpcProvider: os.Getenv("RPC_PROVIDER"),
|
2022-05-17 19:27:35 +02:00
|
|
|
batchContract: os.Getenv("BATCH_CONTRACT"),
|
2022-05-17 15:06:19 +02:00
|
|
|
}
|
|
|
|
|
2022-05-17 15:28:30 +02:00
|
|
|
func TestBatchBalance_Connect(t *testing.T) {
|
2022-05-17 15:06:19 +02:00
|
|
|
name := "Test RPC connection"
|
|
|
|
wantErr := false
|
|
|
|
|
|
|
|
cicnet, _ := NewBatchBalance(conf.rpcProvider, w3.A(conf.batchContract))
|
|
|
|
|
|
|
|
t.Run(name, func(t *testing.T) {
|
|
|
|
if err := cicnet.Close(); (err != nil) != wantErr {
|
|
|
|
t.Errorf("Close() error = %v, wantErr %v", err, wantErr)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|