Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
vanderian committed Nov 28, 2024
1 parent 6520855 commit d9b98c8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,11 @@ ver-api = { git = "https://github.com/gasp-xyz/polkadot-sdk", branch = "eth-roll
[patch."https://github.com/paritytech/polkadot-sdk"]
# ... which satisfies git dependency `sp-crypto-ec-utils` of package `sp-ark-bls12-381 v0.4.2 (https://github.com/paritytech/arkworks-substrate#caa2eed7)`
sp-crypto-ec-utils = { git = "https://github.com/gasp-xyz/polkadot-sdk", branch = "eth-rollup-develop" }


# patch generated by './scripts/dev_manifest.sh ../open-runtime-module-library'
[patch."https://github.com/gasp-xyz/open-runtime-module-library"]
orml-traits = { git = "https://github.com//gasp-xyz/open-runtime-module-library", branch = "feature/locked-tokens" }
orml-asset-registry = { git = "https://github.com//gasp-xyz/open-runtime-module-library", branch = "feature/locked-tokens" }
orml-utilities = { git = "https://github.com//gasp-xyz/open-runtime-module-library", branch = "feature/locked-tokens" }
orml-tokens = { git = "https://github.com//gasp-xyz/open-runtime-module-library", branch = "feature/locked-tokens" }
1 change: 1 addition & 0 deletions pallets/market/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ impl market::Config for Test {
type ComputeIssuance = mocks::MockIssuance;
type NontransferableTokens = Nothing;
type FoundationAccountsProvider = GetDefault;
type ArbitrageBot = Nothing;
}

impl<T: Config> Pallet<T>
Expand Down
30 changes: 15 additions & 15 deletions rollup/runtime/integration-test/src/market.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ fn remove_liquidity_works() {
#[test]
fn multiswap_should_work_xyk() {
test_env().execute_with(|| {
assert_ok!(create_pool(PoolKind::Xyk, (NATIVE_ASSET_ID, ASSET_ID_1)));
assert_ok!(create_pool(PoolKind::Xyk, (ASSET_ID_3, ASSET_ID_1)));
assert_ok!(create_pool(PoolKind::Xyk, (ASSET_ID_1, ASSET_ID_2)));
assert_ok!(create_pool(PoolKind::Xyk, (ASSET_ID_2, ASSET_ID_3)));

assert_ok!(Market::multiswap_asset(
origin(),
vec![POOL_ID_1, POOL_ID_2, POOL_ID_3],
NATIVE_ASSET_ID,
ASSET_ID_3,
UNIT,
ASSET_ID_3,
Zero::zero(),
Expand All @@ -277,7 +277,7 @@ fn multiswap_should_work_xyk() {
AtomicSwap {
pool_id: POOL_ID_1,
kind: PoolKind::Xyk,
asset_in: 0,
asset_in: 3,
asset_out: 1,
amount_in: 1000000000000000000,
amount_out: 453305446940074565,
Expand Down Expand Up @@ -306,7 +306,7 @@ fn multiswap_should_work_xyk() {
#[test]
fn multiswap_should_work_stable_swap_with_bnb() {
test_env().execute_with(|| {
assert_ok!(create_pool(PoolKind::StableSwap, (NATIVE_ASSET_ID, ASSET_ID_1)));
assert_ok!(create_pool(PoolKind::StableSwap, (ASSET_ID_3, ASSET_ID_1)));
assert_ok!(create_pool(PoolKind::StableSwap, (ASSET_ID_1, ASSET_ID_2)));
assert_ok!(create_pool(PoolKind::StableSwap, (ASSET_ID_2, ASSET_ID_3)));
// for bnb
Expand All @@ -319,7 +319,7 @@ fn multiswap_should_work_stable_swap_with_bnb() {
assert_ok!(Market::multiswap_asset(
origin(),
vec![POOL_ID_1, POOL_ID_2, POOL_ID_3],
NATIVE_ASSET_ID,
ASSET_ID_3,
UNIT,
ASSET_ID_3,
Zero::zero(),
Expand All @@ -329,7 +329,7 @@ fn multiswap_should_work_stable_swap_with_bnb() {
// issuance decreased because of bnb
assert!(before > after);
assert_eq!(before, 100000000000000000000);
assert_eq!(after, 99996758378067624442);
assert_eq!(after, 99996802265592678132);

println!("{:#?}", events());

Expand All @@ -339,26 +339,26 @@ fn multiswap_should_work_stable_swap_with_bnb() {
AtomicSwap {
pool_id: POOL_ID_1,
kind: PoolKind::StableSwap,
asset_in: 0,
asset_in: ASSET_ID_3,
asset_out: 1,
amount_in: 1000000000000000000,
amount_out: 995595345298031754,
amount_out: 997511813093464885,
},
AtomicSwap {
pool_id: POOL_ID_2,
kind: PoolKind::StableSwap,
asset_in: 1,
asset_out: 2,
amount_in: 995595345298031754,
amount_out: 991212132384121611,
amount_in: 997511813093464885,
amount_out: 993119273493188322,
},
AtomicSwap {
pool_id: POOL_ID_3,
kind: PoolKind::StableSwap,
asset_in: 2,
asset_out: 3,
amount_in: 991212132384121611,
amount_out: 986850235267668399,
amount_in: 993119273493188322,
amount_out: 988748104475813118,
},
],
}));
Expand All @@ -368,14 +368,14 @@ fn multiswap_should_work_stable_swap_with_bnb() {
#[test]
fn multiswap_should_work_mixed() {
test_env().execute_with(|| {
assert_ok!(create_pool(PoolKind::Xyk, (NATIVE_ASSET_ID, ASSET_ID_1)));
assert_ok!(create_pool(PoolKind::Xyk, (ASSET_ID_3, ASSET_ID_1)));
assert_ok!(create_pool(PoolKind::StableSwap, (ASSET_ID_1, ASSET_ID_2)));
assert_ok!(create_pool(PoolKind::Xyk, (ASSET_ID_2, ASSET_ID_3)));

assert_ok!(Market::multiswap_asset(
origin(),
vec![POOL_ID_1, POOL_ID_2, POOL_ID_3],
NATIVE_ASSET_ID,
ASSET_ID_3,
UNIT,
ASSET_ID_3,
Zero::zero(),
Expand All @@ -389,7 +389,7 @@ fn multiswap_should_work_mixed() {
AtomicSwap {
pool_id: POOL_ID_1,
kind: PoolKind::Xyk,
asset_in: 0,
asset_in: ASSET_ID_3,
asset_out: 1,
amount_in: 1000000000000000000,
amount_out: 453305446940074565,
Expand Down
2 changes: 0 additions & 2 deletions rollup/runtime/integration-test/src/nontransfer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use sp_runtime::AccountId20;

use crate::setup::*;

const ASSET_ID_1: TokenId = NATIVE_ASSET_ID + 1;
Expand Down

0 comments on commit d9b98c8

Please sign in to comment.