From 31f81ddee0de2f33d206350258899b8d3ed86e0a Mon Sep 17 00:00:00 2001 From: 19byte <87568744+19byte@users.noreply.github.com> Date: Sat, 2 Mar 2024 18:39:16 +0800 Subject: [PATCH] fix test case --- signer/storage/aes_gcm_storage_test.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/signer/storage/aes_gcm_storage_test.go b/signer/storage/aes_gcm_storage_test.go index b2eca91739..00f2f21900 100644 --- a/signer/storage/aes_gcm_storage_test.go +++ b/signer/storage/aes_gcm_storage_test.go @@ -99,14 +99,15 @@ func TestEnd2End(t *testing.T) { d := t.TempDir() - s1 := &AESEncryptedStorage{ - filename: fmt.Sprintf("%v/vault.json", d), - key: []byte("AES256Key-32Characters1234567890"), - } - s2 := &AESEncryptedStorage{ - filename: fmt.Sprintf("%v/vault.json", d), - key: []byte("AES256Key-32Characters1234567890"), - } + s1 := NewAESEncryptedStorage( + fmt.Sprintf("%v/vault.json", d), + []byte("AES256Key-32Characters1234567890"), + ) + + s2 := NewAESEncryptedStorage( + fmt.Sprintf("%v/vault.json", d), + []byte("AES256Key-32Characters1234567890"), + ) s1.Put("bazonk", "foobar") if v, err := s2.Get("bazonk"); v != "foobar" || err != nil { @@ -122,10 +123,10 @@ func TestSwappedKeys(t *testing.T) { d := t.TempDir() - s1 := &AESEncryptedStorage{ - filename: fmt.Sprintf("%v/vault.json", d), - key: []byte("AES256Key-32Characters1234567890"), - } + s1 := NewAESEncryptedStorage( + fmt.Sprintf("%v/vault.json", d), + []byte("AES256Key-32Characters1234567890"), + ) s1.Put("k1", "v1") s1.Put("k2", "v2") // Now make a modified copy