Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getTransaction() returning index => undefined #4591

Closed
RastogiAbhijeet opened this issue Feb 12, 2024 · 3 comments
Closed

getTransaction() returning index => undefined #4591

RastogiAbhijeet opened this issue Feb 12, 2024 · 3 comments
Assignees
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. v6 Issues regarding v6

Comments

@RastogiAbhijeet
Copy link

Ethers Version

6.11.0

Search Terms

No response

Describe the Problem

provider.getTransaction is not returning the transaction index.
where as provider.getTransactionReceipt is able to return transaction Index

Code Snippet

> const {ethers} = require("ethers")
undefined

> let lprovider = new ethers.JsonRpcProvider("{rpc_url}")
undefined

> xtx = await lprovider.getTransactionReceipt("0x9dc6cb141309195c0da18f61c618625a447421a9a775092d8ecbd128c7a3cad5")

Can get index from Transaction Receipt

TransactionReceipt {
  provider: JsonRpcProvider {},
  to: '0x67d58E608d9FE526F4e17b62fbF4460e9173C651',
  from: '0xa4C1aE0fed00e02dcb490145d844Bb529B927711',
  contractAddress: null,
  hash: '0x9dc6cb141309195c0da18f61c618625a447421a9a775092d8ecbd128c7a3cad5',


  index: 4, <<< LOOK HERE


  blockHash: '0x62821b1549a9193a7cb35b938afef9e97bd893746e52687525a1300cf6efe19f',
  blockNumber: 179911030,
  logsBloom: '0x00000000000020000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000080000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  gasUsed: 1334979n,
  blobGasUsed: null,
  cumulativeGasUsed: 5440693n,
  gasPrice: 100000000n,
  blobGasPrice: null,
  type: 2,
  status: 1,
  root: undefined
}

Can't get index from TransactionResponse 

> tx = await lprovider.getTransaction("0x9dc6cb141309195c0da18f61c618625a447421a9a775092d8ecbd128c7a3cad5")
TransactionResponse {
  provider: JsonRpcProvider {},
  blockNumber: 179911030,
  blockHash: '0x62821b1549a9193a7cb35b938afef9e97bd893746e52687525a1300cf6efe19f',

  index: undefined, <<<<< LOOK HERE

  hash: '0x9dc6cb141309195c0da18f61c618625a447421a9a775092d8ecbd128c7a3cad5',
  type: 2,
  to: '0x67d58E608d9FE526F4e17b62fbF4460e9173C651',
  from: '0xa4C1aE0fed00e02dcb490145d844Bb529B927711',
  nonce: 7092,
  gasLimit: 2204742n,
  gasPrice: 100000000n,
  maxPriorityFeePerGas: 0n,
  maxFeePerGas: 200000000n,
  maxFeePerBlobGas: null,
  data: '0x1d8557d7',
  value: 0n,
  chainId: 42161n,
  signature: Signature { r: "0x356c09b53335862a13bb5883e3ef7aca843d45667c989acd0b6f3e730c926cab", s: "0x2c40989438df9da1f4607bbe954fb6f924afcc3761f506c9c79cae7a265c953a", yParity: 1, networkV: null },
  accessList: [],
  blobVersionedHashes: null
}

Contract ABI

No response

Errors

No response

Environment

node.js (v12 or newer)

Environment (Other)

No response

@RastogiAbhijeet RastogiAbhijeet added investigate Under investigation and may be a bug. v6 Issues regarding v6 labels Feb 12, 2024
@RastogiAbhijeet
Copy link
Author

looks like it needs to be transactionIndex

@ricmoo
Copy link
Member

ricmoo commented Feb 14, 2024

You are correct! This is a bug and I'll get it into the next patch.

@ricmoo ricmoo added bug Verified to be an issue. on-deck This Enhancement or Bug is currently being worked on. next-patch Issues scheduled for the next arch release. and removed investigate Under investigation and may be a bug. labels Feb 14, 2024
@ricmoo
Copy link
Member

ricmoo commented Feb 14, 2024

Fixed in v6.11.1.

Let me know if you have any other issues.

Thanks! :)

@ricmoo ricmoo closed this as completed Feb 14, 2024
@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. next-patch Issues scheduled for the next arch release. labels Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

2 participants