Tests "sunny day scenario" of a BTC deposit flow with Vault.
BTC is locked in Vault, while GGX:Alice wallet gets KBTC.
- We start BTC and GGX.
- Alice calls ggx::tx().oracle().feed_value().
- Start vault. It connects to both BTC and GGX.
- Mine 50 BTC to address BTC:Alice and mine some blocks on top to confirm.
- Deposit 500k sat to GGX: 5.1 Alice sends ggx::tx().issue().request_issue(500k sat) and waits for event RequestIssue - it contains Vault's BTC pubkey, which should be used to deposit BTC. 5.2 Alice sends 500k sat from BTC:Alice to Vault wallet.
- We check that Alice's KBTC (wrapped BTC) is more than 0, less than 500k sat - some fees are deducted. Amount depends on BTC price (sent to GGX via oracle, step 2).
Tests "sunny day scenario" that users can deposit ERT asset from Cosmos to GGX via Hermes IBC channel. Then, tests that users can withdraw ERT asset from GGX back to Cosmos over same channel.
- We start GGX and Cosmos.
- We start Hermes, which connects to GGX and Cosmos and establishes bidirectional IBC channel.
- Alice calls ggx::tx().assets().force_create() to create asset with id=666 (ERT).
- Deposit:
- Alice uses hermes to deposit 999000ERT from Cosmos:Alice to GGX:Bob.
- We check that Cosmos:Alice balance decreased by 999000ERT.
- We check that GGX:Bob balance increased by 999000ERT.
- Withdraw:
- Alice uses hermes to withdraw 500000ERT from GGX:Bob to Cosmos:Alice.
- We check that GGX:Bob balance decreased by 500000ERT.
- We check that Cosmos:Alice balance increased by 500000ERT.
Tests common DEX functionality. We create 2 assets, then:
- Alice has only asset A, Bob has only asset B.
- Alice creates order to sell A for B.
- We list open orders, and see it.
- Bob fulfills this order.
- Alice creates 3 more orders.
- We list open orders, we see them.
- Alice cancels 1 order.
- We list open orders, we can see that cancelled order is no longer open.