mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-07-25 08:13:12 +00:00
Add a "Create Pool" flow to the AMM app that lets a user open a new liquidity position — seeding a pool's initial liquidity — from token selection and amount entry, through a confirmation dialog, to on-chain submission. - client crate (apps/amm/client): pure, testable protocol logic — account decoding, pair/position modelling, and quote/plan computation — exposed to the app over a C ABI (config/networks.json drives network selection). - C++ runtime + backend: AmmClient, ActiveNetwork, and NewPositionRuntime, wired into AmmUiBackend (new resolve/quote/submit slots). - QML flow: NewPositionForm, NewPositionFlow state, NewPositionConfirmation- Dialog, TokenSelectorModal, and reusable Amm* presentational components (theme, surfaces, buttons) + AmountMath.js. - tests: C++ (NewPositionRuntimeTest, ActiveNetworkTest) and QML (tst_NewPositionForm, tst_LiquidityPage, tst_TokenAmountInput, …).
48 lines
991 B
QML
48 lines
991 B
QML
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
import QtTest
|
|
|
|
import "../../qml/components/liquidity" as Liquidity
|
|
|
|
TestCase {
|
|
id: testCase
|
|
|
|
name: "ResponsivePopups"
|
|
|
|
Liquidity.AmmTheme {
|
|
id: theme
|
|
}
|
|
|
|
Component {
|
|
id: viewportComponent
|
|
|
|
Item {
|
|
width: 320
|
|
height: 300
|
|
}
|
|
}
|
|
|
|
Component {
|
|
id: tokenSelectorComponent
|
|
|
|
Liquidity.TokenSelectorModal {
|
|
theme: theme
|
|
}
|
|
}
|
|
|
|
function test_tokenSelectorStaysInsideShortViewport() {
|
|
var viewport = createTemporaryObject(viewportComponent, testCase)
|
|
var selector = createTemporaryObject(tokenSelectorComponent, viewport, {
|
|
"parent": viewport
|
|
})
|
|
verify(viewport)
|
|
verify(selector)
|
|
|
|
verify(selector.x >= 0)
|
|
verify(selector.y >= 0)
|
|
verify(selector.x + selector.width <= viewport.width)
|
|
verify(selector.y + selector.height <= viewport.height)
|
|
}
|
|
}
|