Skip to content

Commit

Permalink
Merge pull request #9 from keyban-io/chores/receipt-failing
Browse files Browse the repository at this point in the history
Calling receipt() on a tx fails
  • Loading branch information
jiqiang90 authored Jan 13, 2025
2 parents 50fa0ea + 6c29089 commit 9d94525
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/node/src/starknet/api.starknet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ describe('Api.starknet', () => {
expect(blockData.logs[0].transaction.callData.length).toBeGreaterThan(1);
});

it('should have the ability to get receipts via transactions from all types', () => {
it('should have the ability to get receipts via transactions from all types', async () => {
expect(await blockData.transactions[0].receipt?.()).toBeDefined();

expect(typeof blockData.transactions[0].receipt).toEqual('function');
expect(typeof blockData.logs[0].transaction.receipt).toEqual('function');
expect(typeof blockData.logs[0].transaction.from).toEqual('string');
Expand Down
4 changes: 3 additions & 1 deletion packages/node/src/starknet/api.starknet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ export class StarknetApi implements ApiWrapper {
// Format done
...formatTransaction(tx, block, index),
receipt: () =>
this.getTransactionReceipt(tx.hash).then((r) => formatReceipt(r)),
this.getTransactionReceipt(tx.transaction_hash).then((r) =>
formatReceipt(r),
),
logs: block.logs.filter(
(l) => l.transactionHash === tx.transaction_hash,
),
Expand Down

0 comments on commit 9d94525

Please sign in to comment.