@@ -213,10 +213,10 @@ export async function fetchHistory(ncId, count, after) {
213
213
export function * requestHistoryNanoContract ( { payload } ) {
214
214
const { address, ncId, after } = payload ;
215
215
const count = NANO_CONTRACT_TX_HISTORY_SIZE ;
216
-
217
216
const ncEntryKey = formatNanoContractRegistryEntry ( address , ncId ) ;
218
- const allNcs = STORE . getItem ( nanoContractKey . registeredContracts ) || { } ;
219
- if ( ! allNcs [ ncEntryKey ] ) {
217
+ const storage = STORE . getStorage ( ) ;
218
+
219
+ if ( ! storage . isNanoContractRegistered ( ncEntryKey ) ) {
220
220
yield put ( nanoContractHistoryFailure ( failureMessage . notRegistered ) ) ;
221
221
}
222
222
@@ -225,11 +225,10 @@ export function* requestHistoryNanoContract({ payload }) {
225
225
const { history, next } = yield call ( fetchHistory , ncId , count , after ) ;
226
226
227
227
// load into store
228
- const allNcs = STORE . getItem ( nanoContractKey . registeredContracts ) || { } ;
229
- const currentNc = allNcs [ ncEntryKey ] ;
230
- const historyLoaded = currentNc . history || [ ] ;
231
- currentNc . history = [ ...historyLoaded , ...history ] ;
232
- STORE . setItem ( nanoContractKey . registeredContracts , allNcs )
228
+ const ncData = storage . getNanoContract ( ncEntryKey ) ;
229
+ const loadedHistory = ncData . history || [ ] ;
230
+ ncData . history = [ ...loadedHistory , ...history ] ;
231
+ storage . registerNanoContract ( ncEntryKey , ncData ) ;
233
232
234
233
// create an opportunity to load into redux
235
234
yield put ( nanoContractHistoryLoad ( {
0 commit comments