github.com/karalabe/go-ethereum@v0.8.5/accounts/accounts_test.go (about)

     1  package accounts
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/ethereum/go-ethereum/crypto"
     7  	"github.com/ethereum/go-ethereum/crypto/randentropy"
     8  )
     9  
    10  func TestAccountManager(t *testing.T) {
    11  	ks := crypto.NewKeyStorePlain(crypto.DefaultDataDir())
    12  	am := NewAccountManager(ks)
    13  	pass := "" // not used but required by API
    14  	a1, err := am.NewAccount(pass)
    15  	toSign := randentropy.GetEntropyCSPRNG(32)
    16  	_, err = am.Sign(a1, pass, toSign)
    17  	if err != nil {
    18  		t.Fatal(err)
    19  	}
    20  }