Consolidate temp data storage #150

Merged
lash merged 5 commits from consolidate-temp-data-storage into master 2024-10-31 23:47:05 +01:00
Showing only changes of commit 0b4bf58107 - Show all commits

View File

@ -2119,14 +2119,6 @@ func TestSetVoucher(t *testing.T) {
utils.DATA_ACTIVE_ADDRESS: []byte(tempData.ContractAddress), utils.DATA_ACTIVE_ADDRESS: []byte(tempData.ContractAddress),
} }
// Define the temporary entries to be cleared
tempEntries := map[utils.DataTyp][]byte{
utils.DATA_TEMPORARY_SYM: []byte(""),
utils.DATA_TEMPORARY_BAL: []byte(""),
utils.DATA_TEMPORARY_DECIMAL: []byte(""),
utils.DATA_TEMPORARY_ADDRESS: []byte(""),
}
// Mocking ReadEntry calls for temporary data retrieval // Mocking ReadEntry calls for temporary data retrieval
mockDataStore.On("ReadEntry", ctx, sessionId, utils.DATA_TEMPORARY_SYM).Return([]byte(tempData.TokenSymbol), nil) mockDataStore.On("ReadEntry", ctx, sessionId, utils.DATA_TEMPORARY_SYM).Return([]byte(tempData.TokenSymbol), nil)
mockDataStore.On("ReadEntry", ctx, sessionId, utils.DATA_TEMPORARY_BAL).Return([]byte(tempData.Balance), nil) mockDataStore.On("ReadEntry", ctx, sessionId, utils.DATA_TEMPORARY_BAL).Return([]byte(tempData.Balance), nil)
@ -2138,11 +2130,6 @@ func TestSetVoucher(t *testing.T) {
mockDataStore.On("WriteEntry", ctx, sessionId, key, value).Return(nil) mockDataStore.On("WriteEntry", ctx, sessionId, key, value).Return(nil)
} }
// Mocking WriteEntry calls for clearing temporary data
for key, value := range tempEntries {
mockDataStore.On("WriteEntry", ctx, sessionId, key, value).Return(nil)
}
h := &Handlers{ h := &Handlers{
userdataStore: mockDataStore, userdataStore: mockDataStore,
} }