-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Why is hash
optional in TransactionResponse? (typings)
#537
Comments
I've spent the day trying to recall, and cannot. There was a weird case a long time ago, and I suspect it had to do with Ganache, but am not certain. I will try making it non-optional in v5 and see if any issues crop up. I not, in v5 it won't be optional. :) |
That will save me using the bang(!) operator to appease the TS compiler. eg const tx = await signer.sendTransaction(transaction)
const receipt = await provider.waitForTransaction(tx.hash!) |
@naddison36 I have no idea what that post-fix operator does... TypeScript has some crazy things... Is that in the docs anywhere? Is it because you use the strict null checking? |
It was documented in the TypeScript 2.0 release notes https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#non-null-assertion-operator |
Closing this now, as v5 has been updated to reflect this change. Thanks! :) |
I suspect this has to do with submitting a manual transaction vs submitting a transaction to the network as
TransactionResponse
inherits fromTransaction
. Is there ever a case whereTransactionResponse
wouldn't have ahash
?The text was updated successfully, but these errors were encountered: