accounts_test.go 396 B

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