correct test log

This commit is contained in:
Nguyen Sy Thanh Son 2018-04-17 07:38:49 +00:00
parent 246d187294
commit d9ef1c4b90

View file

@ -4,7 +4,6 @@ import (
"math/big" "math/big"
"testing" "testing"
"fmt"
"github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends" "github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
@ -17,7 +16,7 @@ var (
addr = crypto.PubkeyToAddress(key.PublicKey) addr = crypto.PubkeyToAddress(key.PublicKey)
) )
func TestENS(t *testing.T) { func TestValidator(t *testing.T) {
contractBackend := backends.NewSimulatedBackend(core.GenesisAlloc{addr: {Balance: big.NewInt(1000000000)}}) contractBackend := backends.NewSimulatedBackend(core.GenesisAlloc{addr: {Balance: big.NewInt(1000000000)}})
transactOpts := bind.NewKeyedTransactor(key) transactOpts := bind.NewKeyedTransactor(key)
@ -31,6 +30,10 @@ func TestENS(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("can't get candidates: %v", err) t.Fatalf("can't get candidates: %v", err)
} }
fmt.Println("candidates", candidates) t.Log("candidates", candidates)
for _, it := range candidates {
cap, _ := validator.GetCandidateCap(it)
t.Log("candidate", it.String(), "cap", cap)
}
contractBackend.Commit() contractBackend.Commit()
} }