Logo
Explore Help
Sign In
gaspersic/go-ethereum
1
0
Fork 0
You've already forked go-ethereum
Code Issues Pull Requests Projects Releases Wiki Activity
go-ethereum/accounts/accounts_test.go

19 lines
396 B
Go
Raw Normal View History

Add accounts package and refactor key stores * Add initial UserAccount and AccountManager structs * Add NewAccount, Sign and Accounts functions * Refactor key stores to use key address as main identifier while keeping the UUID. * Use key address as file/dir names instead of UUID
2015-01-25 02:07:20 +01:00
package accounts
import (
"github.com/ethereum/go-ethereum/crypto"
"testing"
)
func TestAccountManager(t *testing.T) {
ks := crypto.NewKeyStorePlain(crypto.DefaultDataDir())
am := NewAccountManager(ks)
pass := "" // not used but required by API
a1, err := am.NewAccount(pass)
Address pull request comments * Use crypto.Sign instead of directly calling secp256k1 lib * Rename UserAccount to Account and Addr to Address (for consistency) * Change AccountManager.Sign to take ptr to Account instead of address byte array * Simplify copying of Accounts in Accounts() * PubkeyToAddress and GetEntropyCSPRNG now exported
2015-01-28 05:12:57 +01:00
toSign := crypto.GetEntropyCSPRNG(32)
_, err = am.Sign(a1, pass, toSign)
Add accounts package and refactor key stores * Add initial UserAccount and AccountManager structs * Add NewAccount, Sign and Accounts functions * Refactor key stores to use key address as main identifier while keeping the UUID. * Use key address as file/dir names instead of UUID
2015-01-25 02:07:20 +01:00
if err != nil {
t.Fatal(err)
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.7 Page: 78ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API