Closed vladbochok closed 1 year ago
The l2Signer.provider.getLogProof(txHash) returns the first L2 -> L1 log that sent in L2 transaction with txHash hash. Sometimes, system logs may be sent together with other transaction logs. So the correct code for getting L2 -> L1 logs will be:
l2Signer.provider.getLogProof(txHash)
txHash
const receipt = await this._providerL2().getTransactionReceipt(ethers.utils.hexlify(depositHash)); const successL2ToL1LogIndex = receipt.l2ToL1Logs.findIndex( (l2ToL1log) => l2ToL1log.sender == BOOTLOADER_FORMAL_ADDRESS && l2ToL1log.key == depositHash ); const successL2ToL1Log = receipt.l2ToL1Logs[successL2ToL1LogIndex];
The SDK already implements the proper method, so replace the code with its usage.
Changes incorporated into #147
The
l2Signer.provider.getLogProof(txHash)
returns the first L2 -> L1 log that sent in L2 transaction withtxHash
hash. Sometimes, system logs may be sent together with other transaction logs. So the correct code for getting L2 -> L1 logs will be:The SDK already implements the proper method, so replace the code with its usage.