Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crossChainAccount derivation improvements for /txs/account (#181)
This PR improves the derivation of the `crossChainAccount` (and `crossChainId`) information for cross-chain transfers served by the `/txs/account` endpoint.: * For the send side, it removes the parity check comparing the amount fields of the `TRANSFER` and the `TRANSFER_XCHAIN` events. The check is redundant and it's fragile due to the volatility of decimal representations. * For the receive side, it switches to using the `X_RESUME` event on the receiving transaction as the data source, instead of the `TRANSFER_XCHAIN` event on the sending transaction. This has 2 benefits: It allows us to remove the amount check due to the same reasons, and it avoids relying on the data from an independent block being present. Special thanks to @Takadenoshi for identifying this issue, helping me analyze it and suggesting the fix involving the `X_RESUME` event! * Recover the xchain transfer source from the X_REUSME event * Remove the amount check in send side of xchain transfers It's a fragile comparison with false negatives * Reorder to-from branche conditions to be consistent
- Loading branch information