Skip to content

Commit

Permalink
Merge branch 'main' into feature/WS-49-add-unichain-tx-tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
marianososto authored Oct 18, 2024
2 parents 6ed86d5 + 84eef63 commit 8781da5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export const aptosLogMessagePublishedMapper = (
): LogFoundEvent<LogMessagePublished> | undefined => {
const wormholeEvent = transaction.events.find((tx: any) => tx.type.includes(REDEEM_EVENT_TAIL));
const wormholeData = wormholeEvent.data;

const address = transaction.payload.function.split("::")[0];
const sender = wormholeData.sender.padStart(64, "0");

logger.info(
`[aptos] Source event info: [tx: ${transaction.hash}][VAA: ${CHAIN_ID_APTOS}/${wormholeData.sender}/${wormholeData.sequence}]`
`[aptos] Source event info: [tx: ${transaction.hash}][VAA: ${CHAIN_ID_APTOS}/${sender}/${wormholeData.sequence}]`
);

return {
Expand All @@ -27,7 +27,7 @@ export const aptosLogMessagePublishedMapper = (
blockHeight: transaction.blockHeight,
blockTime: wormholeData.timestamp,
attributes: {
sender: wormholeData.sender,
sender: sender,
sequence: Number(wormholeData.sequence),
payload: wormholeData.payload,
nonce: Number(wormholeData.nonce),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ describe("aptosLogMessagePublishedMapper", () => {
expect(result.attributes.payload).toBe(
"0x01000000000000000000000000000000000000000000000000000000000097d3650000000000000000000000003c499c542cef5e3811e1192ce70d8cc03d5c3359000500000000000000000000000081c1980abe8971e14865a629dd75b07621db1ae100050000000000000000000000000000000000000000000000000000000000001fe0"
);
expect(result.attributes.sender).toBe("1");
expect(result.attributes.sender).toBe(
"0000000000000000000000000000000000000000000000000000000000000001"
);
expect(result.attributes.sequence).toBe(146094);
}
});
Expand Down

0 comments on commit 8781da5

Please sign in to comment.