Skip to content

Commit

Permalink
fix tx status in TxResult (#3435)
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 authored May 21, 2024
1 parent 38c4a73 commit 1dceddf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/client/src/rpc/modules/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const jsonRpcReceipt = async (
? bytesToHex((receipt as PreByzantiumTxReceipt).stateRoot)
: undefined,
status:
((receipt as PostByzantiumTxReceipt).status as unknown) instanceof Uint8Array
(receipt as PostByzantiumTxReceipt).status !== undefined
? intToHex((receipt as PostByzantiumTxReceipt).status)
: undefined,
blobGasUsed: blobGasUsed !== undefined ? bigIntToHex(blobGasUsed) : undefined,
Expand Down
1 change: 1 addition & 0 deletions packages/client/test/rpc/eth/getTransactionReceipt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ describe(method, () => {
const res = await rpc.request(method, [bytesToHex(tx.hash())])

assert.equal(res.result.transactionHash, bytesToHex(tx.hash()), 'should return the correct tx')
assert.equal(res.result.status, '0x1', 'transaction result is 1 since succeeded')
})

it('call with unknown tx hash', async () => {
Expand Down

0 comments on commit 1dceddf

Please sign in to comment.