Commit ffbf649c authored by smartcontracts's avatar smartcontracts Committed by GitHub

Merge pull request #2212 from ethereum-optimism/sc/sdk-wait-for-txs

fix(sdk): have sdk properly wait for transactions
parents 944f75c8 3f4d3c13
---
'@eth-optimism/sdk': patch
---
Have SDK wait for transactions in getMessagesByTransaction
......@@ -143,6 +143,13 @@ export class CrossChainMessenger implements ICrossChainMessenger {
direction?: MessageDirection
} = {}
): Promise<CrossChainMessage[]> {
// Wait for the transaction receipt if the input is waitable.
// TODO: Maybe worth doing this with more explicit typing but whatever for now.
if (typeof (transaction as any).wait === 'function') {
await (transaction as any).wait()
}
// Convert the input to a transaction hash.
const txHash = toTransactionHash(transaction)
let receipt: TransactionReceipt
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment