The previous double swap logic was incorrect resulting in rune swaps polling the wrong txid against the wrong chain. This logic removes the double swap condition and instead just attempts to get the latest txid specified in the outbound transactions array. This will evaluate in three different ways:
Single outbound transaction is rune (asset -> rune): which will return the sellTxId and rely on the swap status for confirmation (sellTxId doesn't appear to actually be used in the downstream logic due to the hasOutboundTx variable in swapper endpoints.ts)
Single outbound transaction is asset (asset or rune -> assest): which will return the outbound txid for the buy chain to poll for status
Double swap transaction (asset -> asset): which will return sellTxId on the first rune swap outbound and rely on swap status which will be pending, and then wait for the final outbound asset tx and return the txid for the buy chain to poll status for
Pull Request Type
[x] :bug: Bug fix (Non-breaking Change: Fixes an issue)
Description
The previous double swap logic was incorrect resulting in rune swaps polling the wrong txid against the wrong chain. This logic removes the double swap condition and instead just attempts to get the latest txid specified in the outbound transactions array. This will evaluate in three different ways:
sellTxId
and rely on the swap status for confirmation (sellTxId
doesn't appear to actually be used in the downstream logic due to thehasOutboundTx
variable in swapperendpoints.ts
)sellTxId
on the first rune swap outbound and rely on swap status which will be pending, and then wait for the final outbound asset tx and return the txid for the buy chain to poll status forPull Request Type
Issue (if applicable)
N/A
Risk
Medium - this changes transaction confirmation logic
Thorchain Swaps
Testing
Engineering
:point_up:
Operations
:point_up:
Screenshots (if applicable)