Closed gomesalexandre closed 2 weeks ago
I'm currently not able to get quotes on this branch, tried both UTXOs and EVMs, with single and cross-account trades.
@0xApotheosis as discussed, way too much "safety" in this PR indeed, voiding very valid accessors at runtime. Fixed in 74ad060060 - and also removed the whole generics dance while at it. The whole if trade quote is defined, hop is defined
was actually invalid.
This prompted us to "fix" types in c437ee2da686cdb40220e4ec464f2dd3093eee2 - note fix
in quotation marks here as most of this is really explicitly checking for undefineds - or adding non-null assertion for first and last hops - which we were not doing before.
Confirmed single hop quotes are happy again:
And so are multi-hops:
Also did a full e2e regression test of a single-hop:
https://github.com/shapeshift/web/assets/17035424/27b9faa3-cd84-4b5a-9c89-94ba1ad15550
And of a multi-hop:
Description
Follows-up on https://github.com/shapeshift/web/pull/6765 with
getHopByIndex
introducing hop access logic consolidation and safety:SupportedTradeQuoteStepIndex
so we make accessors safe by only being to access items at 0th and 1st position, since we don't support multi-hops of more than 2 hops currently). This only ensures easier migration to multi-hops consisting of more than 2 hops when we do support that.getHopByIndex
that:quote
being undefined (or not)Pull Request Type
Issue (if applicable)
Risk
Very low, this should come as no runtime change, do a small regression of swapper end-to-end as paranoia
Testing
Engineering
Operations
Screenshots (if applicable)