mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-07-26 08:43:10 +00:00
fix(amm): avoid confirmation busy binding loop
This commit is contained in:
parent
31f1b68f8c
commit
774e340212
@ -270,11 +270,11 @@ Item {
|
|||||||
TransactionConfirmationDialog {
|
TransactionConfirmationDialog {
|
||||||
id: confirmationDialog
|
id: confirmationDialog
|
||||||
|
|
||||||
|
objectName: "liquidityConfirmationDialog"
|
||||||
title: qsTr("Confirm new position")
|
title: qsTr("Confirm new position")
|
||||||
confirmText: qsTr("Submit")
|
confirmText: qsTr("Submit")
|
||||||
busy: newPositionFlow.submitting
|
busy: newPositionFlow.submitting
|
||||||
|| (opened && snapshot.quoteReady === false
|
|| (snapshot.quoteReady === false && newPositionFlow.quoteLoading)
|
||||||
&& newPositionFlow.quoteLoading)
|
|
||||||
confirmEnabled: snapshot.quoteReady === true
|
confirmEnabled: snapshot.quoteReady === true
|
||||||
&& newPositionFlow.walletCanSubmit
|
&& newPositionFlow.walletCanSubmit
|
||||||
summary: liquidityConfirmationSummary
|
summary: liquidityConfirmationSummary
|
||||||
|
|||||||
@ -181,6 +181,44 @@ TestCase {
|
|||||||
compare(backend.submitCalls, 1)
|
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() {
|
function test_missingPoolSubmissionStartsPoolProbeWithoutWalletRefresh() {
|
||||||
var backend = createTemporaryObject(backendComponent, testCase, {
|
var backend = createTemporaryObject(backendComponent, testCase, {
|
||||||
"submitResult": {
|
"submitResult": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user