Compare commits

..

No commits in common. "06c534cbb1c2b513a1ac6f1485c57f87ff3b1918" and "71c01e00cd6a4468831d05dd0b61bd236882b4c2" have entirely different histories.

View File

@ -2124,19 +2124,20 @@ func TestCheckVouchers(t *testing.T) {
func TestGetVoucherList(t *testing.T) { func TestGetVoucherList(t *testing.T) {
sessionId := "session123" sessionId := "session123"
ctx, store := InitializeTestStore(t) ctx := context.WithValue(context.Background(), "SessionId", sessionId)
ctx = context.WithValue(ctx, "SessionId", sessionId)
spdb := InitializeTestSubPrefixDb(t, ctx)
// Initialize MenuHandlers // Initialize MenuHandlers
h := &MenuHandlers{ h := &MenuHandlers{
userdataStore: store, prefixDb: spdb,
ReplaceSeparatorFunc: mockReplaceSeparator, ReplaceSeparatorFunc: mockReplaceSeparator,
} }
mockSyms := []byte("1:SRF\n2:MILO") mockSyms := []byte("1:SRF\n2:MILO")
// Put voucher sym data from the store // Put voucher sym data from the store
err := store.WriteEntry(ctx, sessionId, storedb.DATA_VOUCHER_SYMBOLS, mockSyms) err := spdb.Put(ctx, storedb.ToBytes(storedb.DATA_VOUCHER_SYMBOLS), mockSyms)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -2156,11 +2157,15 @@ func TestViewVoucher(t *testing.T) {
} }
ctx, store := InitializeTestStore(t) ctx, store := InitializeTestStore(t)
sessionId := "session123" sessionId := "session123"
ctx = context.WithValue(ctx, "SessionId", sessionId) ctx = context.WithValue(ctx, "SessionId", sessionId)
spdb := InitializeTestSubPrefixDb(t, ctx)
h := &MenuHandlers{ h := &MenuHandlers{
userdataStore: store, userdataStore: store,
flagManager: fm, flagManager: fm,
prefixDb: spdb,
} }
// Define mock voucher data // Define mock voucher data
@ -2173,7 +2178,7 @@ func TestViewVoucher(t *testing.T) {
// Put the data // Put the data
for key, value := range mockData { for key, value := range mockData {
err := store.WriteEntry(ctx, sessionId, key, []byte(value)) err = spdb.Put(ctx, []byte(storedb.ToBytes(key)), []byte(value))
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }