Mapped txs array

This commit is contained in:
julian merlo 2024-03-25 19:08:52 -03:00
parent e12e6cb576
commit ae196875d2
1 changed files with 7 additions and 7 deletions

View File

@ -9,14 +9,14 @@ let logger: winston.Logger = winston.child({ module: "wormchainLogMessagePublish
export const wormchainLogMessagePublishedMapper = (
log: WormchainLog
): LogFoundEvent<LogMessagePublished[]> | [] => {
): LogFoundEvent<LogMessagePublished>[] | [] => {
const transactionAttributesMapped = transactionAttributes(log);
if (transactionAttributesMapped.length === 0) {
return [];
}
const logMessages: any = [];
const logMessages: LogFoundEvent<LogMessagePublished>[] = [];
transactionAttributesMapped.forEach((tx) => {
logger.info(
@ -27,14 +27,14 @@ export const wormchainLogMessagePublishedMapper = (
name: "log-message-published",
address: CORE_ADDRESS,
chainId: 3104,
txHash: tx.hash,
txHash: tx.hash!,
blockHeight: log.blockHeight,
blockTime: log.timestamp,
attributes: {
sender: tx.emitter,
sequence: tx.sequence,
payload: tx.payload,
nonce: tx.nonce,
sender: tx.emitter!,
sequence: tx.sequence!,
payload: tx.payload!,
nonce: tx.nonce!,
consistencyLevel: 0,
},
});