mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-25 14:11:09 +00:00
fix(liquidity): show fixed active pool fee
This commit is contained in:
@@ -92,6 +92,8 @@ AmmActionCard {
|
||||
readonly property string poolStatus: root.effectivePoolStatus()
|
||||
readonly property bool activePool: root.poolStatus === "active_pool"
|
||||
readonly property bool missingPool: root.poolStatus === "missing_pool"
|
||||
readonly property bool feeSelectionRequired: !root.contextLoading && root.missingPool
|
||||
readonly property bool fixedPoolFeeVisible: !root.contextLoading && root.activePool
|
||||
readonly property int poolFeeBps: root.knownPoolFeeBps()
|
||||
readonly property bool compact: root.width < 420
|
||||
readonly property bool hasPair: root.selectedTokenAId.length > 0
|
||||
@@ -381,9 +383,12 @@ AmmActionCard {
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: feeTierSelector
|
||||
|
||||
objectName: "feeTierSelector"
|
||||
Layout.fillWidth: true
|
||||
spacing: 8
|
||||
visible: !root.contextLoading
|
||||
visible: root.feeSelectionRequired
|
||||
|
||||
Text {
|
||||
text: qsTr("Fee tier")
|
||||
@@ -461,6 +466,30 @@ AmmActionCard {
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 10
|
||||
visible: root.fixedPoolFeeVisible
|
||||
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Fee tier")
|
||||
color: root.theme.colors.textSecondary
|
||||
font.pixelSize: 12
|
||||
}
|
||||
|
||||
Text {
|
||||
id: fixedPoolFee
|
||||
|
||||
objectName: "fixedPoolFee"
|
||||
text: root.feeLabel(root.poolFeeBps > 0
|
||||
? root.poolFeeBps : root.selectedFeeBps)
|
||||
color: root.theme.colors.textPrimary
|
||||
font.pixelSize: 12
|
||||
font.weight: Font.Medium
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 10
|
||||
|
||||
@@ -198,6 +198,29 @@ TestCase {
|
||||
verify(amountBInput.invalid)
|
||||
}
|
||||
|
||||
function test_activePoolShowsFixedFeeInsteadOfSelector() {
|
||||
var form = createForm()
|
||||
form.flowState = flowState({
|
||||
"schema": "new-position.v2",
|
||||
"status": "ok",
|
||||
"tokenAId": tokenHigh,
|
||||
"tokenBId": tokenLow,
|
||||
"poolStatus": "active_pool",
|
||||
"poolFeeBps": 5
|
||||
})
|
||||
form.visible = true
|
||||
wait(0)
|
||||
compare(form.poolStatus, "active_pool")
|
||||
|
||||
var selector = findChild(form, "feeTierSelector")
|
||||
var fixedFee = findChild(form, "fixedPoolFee")
|
||||
verify(selector)
|
||||
verify(fixedFee)
|
||||
compare(form.feeSelectionRequired, false)
|
||||
compare(form.fixedPoolFeeVisible, true)
|
||||
compare(fixedFee.text, "0.05%")
|
||||
}
|
||||
|
||||
function test_contextRefreshSelectsSingleHoldingsBeforeQuote() {
|
||||
var form = createForm()
|
||||
form.selectedHoldingAId = ""
|
||||
|
||||
Reference in New Issue
Block a user