mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-07-19 13:29:56 +00:00
fix(amm): avoid confirmation busy binding loop
This commit is contained in:
parent
31f1b68f8c
commit
774e340212
@ -270,11 +270,11 @@ Item {
|
||||
TransactionConfirmationDialog {
|
||||
id: confirmationDialog
|
||||
|
||||
objectName: "liquidityConfirmationDialog"
|
||||
title: qsTr("Confirm new position")
|
||||
confirmText: qsTr("Submit")
|
||||
busy: newPositionFlow.submitting
|
||||
|| (opened && snapshot.quoteReady === false
|
||||
&& newPositionFlow.quoteLoading)
|
||||
|| (snapshot.quoteReady === false && newPositionFlow.quoteLoading)
|
||||
confirmEnabled: snapshot.quoteReady === true
|
||||
&& newPositionFlow.walletCanSubmit
|
||||
summary: liquidityConfirmationSummary
|
||||
|
||||
@ -181,6 +181,44 @@ TestCase {
|
||||
compare(backend.submitCalls, 1)
|
||||
}
|
||||
|
||||
function test_submissionCompletionClosesConfirmationWithoutBindingLoop() {
|
||||
failOnWarning(/Binding loop detected for property "busy"/)
|
||||
|
||||
var backend = createTemporaryObject(backendComponent, testCase, {
|
||||
"deferSubmitResult": true
|
||||
})
|
||||
var page = createTemporaryObject(pageComponent, testCase, {
|
||||
"backend": backend,
|
||||
"visible": true
|
||||
})
|
||||
verify(page)
|
||||
|
||||
var dialog = findChild(page, "liquidityConfirmationDialog")
|
||||
verify(dialog)
|
||||
dialog.openWithSnapshot({
|
||||
"quoteReady": true,
|
||||
"request": ({}),
|
||||
"quoteHash": "sha256:expected"
|
||||
})
|
||||
tryCompare(dialog, "opened", true)
|
||||
|
||||
dialog.confirm()
|
||||
tryCompare(page.flow, "submitting", true)
|
||||
compare(dialog.busy, true)
|
||||
|
||||
backend.newPositionSubmitResult = {
|
||||
"schema": "new-position.v2",
|
||||
"status": "submitted",
|
||||
"transactionId": submittedTransactionId,
|
||||
"deadlineMs": String(Date.now() + 60000),
|
||||
"affectedAccountIds": [],
|
||||
"requestId": page.flow.submitRequestId
|
||||
}
|
||||
|
||||
tryCompare(page.flow, "submitting", false)
|
||||
tryCompare(dialog, "opened", false)
|
||||
}
|
||||
|
||||
function test_missingPoolSubmissionStartsPoolProbeWithoutWalletRefresh() {
|
||||
var backend = createTemporaryObject(backendComponent, testCase, {
|
||||
"submitResult": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user