mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
fix test case
This commit is contained in:
parent
b464391a45
commit
31f81ddee0
1 changed files with 13 additions and 12 deletions
|
|
@ -99,14 +99,15 @@ func TestEnd2End(t *testing.T) {
|
||||||
|
|
||||||
d := t.TempDir()
|
d := t.TempDir()
|
||||||
|
|
||||||
s1 := &AESEncryptedStorage{
|
s1 := NewAESEncryptedStorage(
|
||||||
filename: fmt.Sprintf("%v/vault.json", d),
|
fmt.Sprintf("%v/vault.json", d),
|
||||||
key: []byte("AES256Key-32Characters1234567890"),
|
[]byte("AES256Key-32Characters1234567890"),
|
||||||
}
|
)
|
||||||
s2 := &AESEncryptedStorage{
|
|
||||||
filename: fmt.Sprintf("%v/vault.json", d),
|
s2 := NewAESEncryptedStorage(
|
||||||
key: []byte("AES256Key-32Characters1234567890"),
|
fmt.Sprintf("%v/vault.json", d),
|
||||||
}
|
[]byte("AES256Key-32Characters1234567890"),
|
||||||
|
)
|
||||||
|
|
||||||
s1.Put("bazonk", "foobar")
|
s1.Put("bazonk", "foobar")
|
||||||
if v, err := s2.Get("bazonk"); v != "foobar" || err != nil {
|
if v, err := s2.Get("bazonk"); v != "foobar" || err != nil {
|
||||||
|
|
@ -122,10 +123,10 @@ func TestSwappedKeys(t *testing.T) {
|
||||||
|
|
||||||
d := t.TempDir()
|
d := t.TempDir()
|
||||||
|
|
||||||
s1 := &AESEncryptedStorage{
|
s1 := NewAESEncryptedStorage(
|
||||||
filename: fmt.Sprintf("%v/vault.json", d),
|
fmt.Sprintf("%v/vault.json", d),
|
||||||
key: []byte("AES256Key-32Characters1234567890"),
|
[]byte("AES256Key-32Characters1234567890"),
|
||||||
}
|
)
|
||||||
s1.Put("k1", "v1")
|
s1.Put("k1", "v1")
|
||||||
s1.Put("k2", "v2")
|
s1.Put("k2", "v2")
|
||||||
// Now make a modified copy
|
// Now make a modified copy
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue