cic-go/batch_balance/batch_balance_test.go
Mohamed Sohail 8ebcbbf479
add: (wip) on-chain balance query (#5)
* add: smart-contracts

* add: implement and test

changes to contract:
- returns 0 instead of false error status
- func return type is []big.Int

* fix: test name

* fix: (test) env var name
2022-05-17 20:33:03 +03:00

32 lines
584 B
Go

package balance
import (
"os"
"testing"
"github.com/lmittmann/w3"
)
type tConfig struct {
rpcProvider string
batchContract string
}
var conf = &tConfig{
rpcProvider: os.Getenv("RPC_PROVIDER"),
batchContract: os.Getenv("BATCH_CONTRACT"),
}
func TestBatchBalance_Connect(t *testing.T) {
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)
}
})
}