Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use bounded vec in extrinsics #1023

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "runtime-integration-tests"
version = "1.33.1"
version = "1.33.2"
description = "Integration tests"
authors = ["GalacticCouncil"]
edition = "2021"
Expand Down
26 changes: 13 additions & 13 deletions integration-tests/src/dca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ mod omnipool {
DAI,
amount_out,
Balance::MAX,
trade
BoundedVec::truncate_from(trade)
));

//Assert
Expand Down Expand Up @@ -606,7 +606,7 @@ mod omnipool {
DAI,
amount_out,
Balance::MAX,
trade
BoundedVec::truncate_from(trade)
));

//Assert
Expand Down Expand Up @@ -1632,7 +1632,7 @@ mod omnipool {
DAI,
amount_to_sell,
0,
trade
BoundedVec::truncate_from(trade)
));

//Assert
Expand Down Expand Up @@ -1718,7 +1718,7 @@ mod omnipool {
DAI,
amount_to_sell,
0,
trade
BoundedVec::truncate_from(trade)
));

//Assert
Expand Down Expand Up @@ -2542,7 +2542,7 @@ mod stableswap {
stable_asset_1,
amount_to_sell,
0,
trades
BoundedVec::truncate_from(trades)
));

//Assert
Expand Down Expand Up @@ -2869,7 +2869,7 @@ mod stableswap {
HDX,
amount_to_sell,
0,
trades
BoundedVec::truncate_from(trades)
));

//Assert
Expand Down Expand Up @@ -3526,7 +3526,7 @@ mod with_onchain_route {
assert_ok!(Router::set_route(
hydradx_runtime::RuntimeOrigin::signed(ALICE.into()),
asset_pair,
trades.clone()
trades.clone().try_into().unwrap()
));
assert_eq!(Router::route(asset_pair).unwrap(), trades);

Expand Down Expand Up @@ -3640,7 +3640,7 @@ mod with_onchain_route {
assert_ok!(Router::set_route(
hydradx_runtime::RuntimeOrigin::signed(ALICE.into()),
asset_pair,
trades.clone()
trades.clone().try_into().unwrap()
));
assert_eq!(Router::route(asset_pair).unwrap(), trades);

Expand Down Expand Up @@ -3757,7 +3757,7 @@ mod with_onchain_route {
DOT,
amount_to_sell,
0,
vec![]
BoundedVec::new()
));
let alice_received_dot =
Currencies::free_balance(DOT, &AccountId::from(ALICE)) - alice_init_dot_balance;
Expand Down Expand Up @@ -3871,7 +3871,7 @@ mod with_onchain_route {
assert_ok!(Router::set_route(
hydradx_runtime::RuntimeOrigin::signed(ALICE.into()),
asset_pair,
trades.clone()
trades.clone().try_into().unwrap()
));
assert_eq!(Router::route(asset_pair).unwrap(), trades);

Expand Down Expand Up @@ -3904,7 +3904,7 @@ mod with_onchain_route {
stable_asset_1,
amount_to_sell,
0,
vec![]
BoundedVec::new()
));
let alice_received_stable =
Currencies::free_balance(stable_asset_1, &AccountId::from(ALICE)) - alice_init_stable_balance;
Expand Down Expand Up @@ -3991,7 +3991,7 @@ mod with_onchain_route {
assert_ok!(Router::set_route(
hydradx_runtime::RuntimeOrigin::signed(ALICE.into()),
asset_pair,
trades.clone()
trades.clone().try_into().unwrap()
));
assert_eq!(Router::route(asset_pair).unwrap(), trades);

Expand Down Expand Up @@ -4024,7 +4024,7 @@ mod with_onchain_route {
DOT,
fee_in_hdx,
0,
vec![]
BoundedVec::new()
));
let alice_received_dot =
Currencies::free_balance(DOT, &AccountId::from(ALICE)) - ALICE_INITIAL_DOT_BALANCE;
Expand Down
4 changes: 3 additions & 1 deletion integration-tests/src/erc20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ use hydradx_traits::AssetKind;
use hydradx_traits::Create;
use orml_traits::MultiCurrency;
use pallet_evm::ExitSucceed::Returned;
use sp_core::bounded_vec::BoundedVec;

use pallet_evm_accounts::EvmNonceProvider;
use polkadot_xcm::v3::Junction::AccountKey20;
use polkadot_xcm::v3::Junctions::X1;
Expand Down Expand Up @@ -455,7 +457,7 @@ fn erc20_currency_is_tradeable_in_omnipool() {
DAI,
1_000,
1,
vec![],
BoundedVec::new(),
));
});
}
Expand Down
4 changes: 3 additions & 1 deletion integration-tests/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use frame_support::traits::fungible::Mutate;
use frame_support::{assert_ok, dispatch::GetDispatchInfo, sp_runtime::codec::Encode, traits::Contains};
use frame_system::RawOrigin;
use hex_literal::hex;
use sp_core::bounded_vec::BoundedVec;

use hydradx_runtime::evm::precompiles::DISPATCH_ADDR;
use hydradx_runtime::evm::EvmAddress;
use hydradx_runtime::evm::ExtendedAddressMapping;
Expand Down Expand Up @@ -1445,7 +1447,7 @@ fn dispatch_should_work_with_buying_insufficient_asset() {
asset_out: altcoin,
amount_out: UNITS,
max_amount_in: u128::MAX,
route: swap_route,
route: BoundedVec::truncate_from(swap_route),
});

//Arrange
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/src/exchange_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ fn hydra_should_swap_assets_when_receiving_from_acala_with_sell() {
ACA,
UNITS,
0,
vec![],
BoundedVec::new(),
));

let last_swapped_events: Vec<pallet_broadcast::Event<hydradx_runtime::Runtime>> = get_last_swapped_events();
Expand Down
Loading
Loading