mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
accounts/keystore: added import/export tests
This commit is contained in:
parent
62f238ecf0
commit
61e458ae41
1 changed files with 6 additions and 1 deletions
|
|
@ -377,12 +377,17 @@ func TestImportExport(t *testing.T) {
|
|||
if _, err = ks2.Import(json, "old", "old"); err == nil {
|
||||
t.Errorf("importing with invalid password succeeded")
|
||||
}
|
||||
if _, err = ks2.Import(json, "new", "new"); err != nil {
|
||||
acc2, err := ks2.Import(json, "new", "new")
|
||||
if err != nil {
|
||||
t.Errorf("importing failed: %v", err)
|
||||
}
|
||||
if acc.Address != acc2.Address {
|
||||
t.Error("imported account does not match exported account")
|
||||
}
|
||||
if _, err = ks2.Import(json, "new", "new"); err == nil {
|
||||
t.Errorf("importing a key twice succeeded")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TestImportRace tests the keystore on races.
|
||||
|
|
|
|||
Loading…
Reference in a new issue