mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-25 14:11:09 +00:00
fix(liquidity): classify fee retries as pool probes
This commit is contained in:
@@ -1432,11 +1432,15 @@ AmmActionCard {
|
||||
if (root.poolFeeBps > 0 && root.selectedFeeBps !== root.poolFeeBps) {
|
||||
root.selectedFeeBps = root.poolFeeBps
|
||||
root.localErrors = []
|
||||
root.quoteRequested(true, {
|
||||
var retry = {
|
||||
"ok": true,
|
||||
"errors": [],
|
||||
"request": root.poolProbeRequest(root.pairRequest())
|
||||
})
|
||||
}
|
||||
retry.poolDiscoveryProbe = root.activePool
|
||||
&& root.amountA.length === 0
|
||||
&& root.amountB.length === 0
|
||||
root.quoteRequested(true, retry)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -473,6 +473,31 @@ TestCase {
|
||||
compare(form.localErrors.length, 0)
|
||||
}
|
||||
|
||||
function test_feeTierCorrectionKeepsEmptyDraftProbeNonSubmittable() {
|
||||
var form = createForm()
|
||||
quoteRequestedSpy.target = form
|
||||
quoteRequestedSpy.clear()
|
||||
|
||||
form.flowState = flowState({
|
||||
"schema": "new-position.v2",
|
||||
"status": "error",
|
||||
"code": "fee_tier_mismatch",
|
||||
"tokenAId": tokenHigh,
|
||||
"tokenBId": tokenLow,
|
||||
"poolStatus": "active_pool",
|
||||
"poolFeeBps": 5,
|
||||
"errors": [{
|
||||
"code": "fee_tier_mismatch",
|
||||
"details": { "poolFeeBps": 5 }
|
||||
}]
|
||||
})
|
||||
|
||||
tryCompare(quoteRequestedSpy, "count", 1)
|
||||
var retry = quoteRequestedSpy.signalArguments[0][1]
|
||||
compare(retry.request.feeBps, 5)
|
||||
compare(retry.poolDiscoveryProbe, true)
|
||||
}
|
||||
|
||||
function test_submissionSnapshotCarriesPoolAccountForProbe() {
|
||||
var form = createForm()
|
||||
form.flowState = flowState({
|
||||
|
||||
Reference in New Issue
Block a user