Use the DATATYPE_USERDATA as the prefix for the NewSubPrefixDb func

This commit is contained in:
2024-12-05 17:02:26 +03:00
parent a659fb06fa
commit 589a94216b
3 changed files with 11 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ import (
"github.com/alecthomas/assert/v2"
"github.com/stretchr/testify/require"
visedb "git.defalsify.org/vise.git/db"
memdb "git.defalsify.org/vise.git/db/mem"
"git.grassecon.net/urdt/ussd/internal/storage"
dataserviceapi "github.com/grassrootseconomics/ussd-data-service/pkg/api"
@@ -83,7 +84,9 @@ func TestGetVoucherData(t *testing.T) {
if err != nil {
t.Fatal(err)
}
spdb := storage.NewSubPrefixDb(db, []byte("vouchers"))
prefix := IntToBytes(visedb.DATATYPE_USERDATA)
spdb := storage.NewSubPrefixDb(db, prefix)
// Test voucher data
mockData := map[DataTyp][]byte{