diff --git a/src/Data/Collector.ts b/src/Data/Collector.ts index 0b31a439..7638e5b2 100644 --- a/src/Data/Collector.ts +++ b/src/Data/Collector.ts @@ -968,7 +968,7 @@ export const storeReceiptData = async ( txId: tx.txId, cycle: cycle, txTimestamp: tx.timestamp, - txApplyTimestamp: null, + applyTimestamp, } // await Transaction.insertTransaction(txObj) @@ -1157,7 +1157,7 @@ export const storeAccountData = async (restoreData: StoreAccountParam = {}): Pro txId: receipt.data.txId || receipt.txId, cycle: receipt.cycleNumber, txTimestamp: receipt.timestamp, - txApplyTimestamp: null, + applyTimestamp: receipt.timestamp, } combineTransactions.push(txObj) combineProcessedTxs.push(processedTx) diff --git a/src/dbstore/index.ts b/src/dbstore/index.ts index 94fb0899..1ba69c5b 100644 --- a/src/dbstore/index.ts +++ b/src/dbstore/index.ts @@ -101,7 +101,7 @@ export const initializeDB = async (config: Config): Promise => { // Transaction digester service tables await runCreate( processedTxDatabase, - 'CREATE TABLE if not exists `processedTxs` (`txId` VARCHAR(128) NOT NULL, `cycle` BIGINT NOT NULL, `txTimestamp` BIGINT NOT NULL, `txApplyTimestamp` BIGINT, PRIMARY KEY (`txId`))' + 'CREATE TABLE if not exists `processedTxs` (`txId` VARCHAR(128) NOT NULL, `cycle` BIGINT NOT NULL, `txTimestamp` BIGINT NOT NULL, `applyTimestamp` BIGINT NOT NULL, PRIMARY KEY (`txId`))' ) await runCreate( processedTxDatabase, diff --git a/src/dbstore/processedTxs.ts b/src/dbstore/processedTxs.ts index 1f2c5f06..259d032d 100644 --- a/src/dbstore/processedTxs.ts +++ b/src/dbstore/processedTxs.ts @@ -10,7 +10,7 @@ export interface ProcessedTransaction { txId: string cycle: number txTimestamp: number - txApplyTimestamp: number + applyTimestamp: number } export async function insertProcessedTx(processedTx: ProcessedTransaction): Promise { @@ -26,7 +26,7 @@ export async function insertProcessedTx(processedTx: ProcessedTransaction): Prom ') ON CONFLICT (txId) DO UPDATE SET ' + 'cycle = excluded.cycle, ' + 'txTimestamp = excluded.txTimestamp, ' + - 'txApplyTimestamp = excluded.txApplyTimestamp' + 'applyTimestamp = excluded.applyTimestamp' await db.run(processedTxDatabase, sql, values) if (config.VERBOSE) { @@ -55,7 +55,7 @@ export async function bulkInsertProcessedTxs(processedTxs: ProcessedTransaction[ ' ON CONFLICT (txId) DO UPDATE SET ' + 'cycle = excluded.cycle, ' + 'txTimestamp = excluded.txTimestamp, ' + - 'txApplyTimestamp = excluded.txApplyTimestamp' + 'applyTimestamp = excluded.applyTimestamp' await db.run(processedTxDatabase, sql, values) if (config.VERBOSE)