Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v0.9.82' into lend-market
Browse files Browse the repository at this point in the history
yooml authored Sep 11, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents a3c63f5 + 0323af5 commit e5513d7
Showing 56 changed files with 2,559 additions and 1,724 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Release

env:
SUBWASM_VERSION: 0.19.0
SUBWASM_VERSION: 0.20.0

on:
push:
@@ -93,7 +93,7 @@ jobs:
${{ github.workspace }}/artifacts/bifrost_polkadot_runtime.compact.compressed.wasm
- uses: 8398a7/action-slack@v3
if: failure()
if: always()
with:
status: ${{ job.status }}
fields: repo,author,eventName,workflow,ref,commit
1 change: 0 additions & 1 deletion .github/workflows/srtool.yml
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@ jobs:
with:
chain: ${{ matrix.chain }}
runtime_dir: runtime/${{ matrix.chain }}
tag: 1.66.1
- name: Summary
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.chain }}-srtool-digest.json
5 changes: 3 additions & 2 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
@@ -67,33 +67,28 @@ fn relaychain_transact_works() {
});

Bifrost::execute_with(|| {
// QueryStatus::Pending { responder: V3(MultiLocation { parents: 1, interior: Here }),
// maybe_match_querier: Some(V3(MultiLocation { parents: 0, interior: Here })),
// maybe_notify: Some((0, 7)), timeout: 100 } let query_id =
let notify_vote_call_weight = notify_vote_call.get_dispatch_info().weight;
let query_id = pallet_xcm::Pallet::<Runtime>::new_notify_query(
MultiLocation::parent(),
notify_vote_call,
100u32.into(),
Here,
);

// QueryResponse { query_id: 0, response: DispatchResult(Success), max_weight: Weight {
// ref_time: 4000000000, proof_size: 0 }, querier: Some(MultiLocation { parents: 0,
// interior: Here }) }
let asset: MultiAsset =
MultiAsset { id: Concrete(MultiLocation::here()), fun: Fungible(4000000000) };
MultiAsset { id: Concrete(MultiLocation::here()), fun: Fungible(517318631) };
let msg = Xcm(vec![
WithdrawAsset(asset.clone().into()),
BuyExecution { fees: asset, weight_limit: Unlimited },
Transact {
origin_kind: OriginKind::SovereignAccount,
require_weight_at_most: Weight::from_parts(4000000000, 100000),
require_weight_at_most: Weight::from_parts(961496000, 83866),
call: vote_call.encode().into(),
},
ReportTransactStatus(QueryResponseInfo {
destination: MultiLocation::from(X1(Parachain(2001))),
query_id,
max_weight: Weight::from_parts(3000000, 0),
max_weight: notify_vote_call_weight,
}),
RefundSurplus,
DepositAsset {
136 changes: 72 additions & 64 deletions integration-tests/bifrost-kusama/src/slp.rs
Original file line number Diff line number Diff line change
@@ -81,11 +81,9 @@ delegate/undelegate/redelegate confirm_validators_by_delegator_query_response

#![cfg(test)]
use bifrost_kusama_runtime::{NativeCurrencyId, VtokenMinting};
use bifrost_slp::{
primitives::UnlockChunk, Delays, Ledger, MinimumsMaximums, SubstrateLedger, XcmOperation,
};
use bifrost_slp::{primitives::UnlockChunk, Delays, Ledger, MinimumsMaximums, SubstrateLedger};
use frame_support::{assert_ok, BoundedVec};
use node_primitives::TimeUnit;
use node_primitives::{TimeUnit, XcmInterfaceOperation as XcmOperation};
use orml_traits::MultiCurrency;
use pallet_staking::{Nominations, StakingLedger};
use sp_runtime::Permill;
@@ -253,75 +251,85 @@ fn slp_setup() {
));

// Register Operation weight and fee
assert_ok!(Slp::set_xcm_dest_weight_and_fee(
RuntimeOrigin::root(),
RelayCurrencyId::get(),
XcmOperation::TransferTo,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
));
assert_ok!(
<Runtime as bifrost_slp::Config>::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee(
RelayCurrencyId::get(),
XcmOperation::TransferTo,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
)
);

assert_ok!(Slp::set_xcm_dest_weight_and_fee(
RuntimeOrigin::root(),
RelayCurrencyId::get(),
XcmOperation::Bond,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
));
assert_ok!(
<Runtime as bifrost_slp::Config>::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee(
RelayCurrencyId::get(),
XcmOperation::Bond,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
)
);

assert_ok!(Slp::set_xcm_dest_weight_and_fee(
RuntimeOrigin::root(),
RelayCurrencyId::get(),
XcmOperation::BondExtra,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
));
assert_ok!(
<Runtime as bifrost_slp::Config>::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee(
RelayCurrencyId::get(),
XcmOperation::BondExtra,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
)
);

assert_ok!(Slp::set_xcm_dest_weight_and_fee(
RuntimeOrigin::root(),
RelayCurrencyId::get(),
XcmOperation::Unbond,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
));
assert_ok!(
<Runtime as bifrost_slp::Config>::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee(
RelayCurrencyId::get(),
XcmOperation::Unbond,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
)
);

assert_ok!(Slp::set_xcm_dest_weight_and_fee(
RuntimeOrigin::root(),
RelayCurrencyId::get(),
XcmOperation::Rebond,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
));
assert_ok!(
<Runtime as bifrost_slp::Config>::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee(
RelayCurrencyId::get(),
XcmOperation::Rebond,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
)
);

assert_ok!(Slp::set_xcm_dest_weight_and_fee(
RuntimeOrigin::root(),
RelayCurrencyId::get(),
XcmOperation::Delegate,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
));
assert_ok!(
<Runtime as bifrost_slp::Config>::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee(
RelayCurrencyId::get(),
XcmOperation::Delegate,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
)
);

assert_ok!(Slp::set_xcm_dest_weight_and_fee(
RuntimeOrigin::root(),
RelayCurrencyId::get(),
XcmOperation::Payout,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
));
assert_ok!(
<Runtime as bifrost_slp::Config>::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee(
RelayCurrencyId::get(),
XcmOperation::Payout,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
)
);

assert_ok!(Slp::set_xcm_dest_weight_and_fee(
RuntimeOrigin::root(),
RelayCurrencyId::get(),
XcmOperation::Liquidize,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
));
assert_ok!(
<Runtime as bifrost_slp::Config>::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee(
RelayCurrencyId::get(),
XcmOperation::Liquidize,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
)
);

assert_ok!(Slp::set_xcm_dest_weight_and_fee(
RuntimeOrigin::root(),
RelayCurrencyId::get(),
XcmOperation::Chill,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
));
assert_ok!(
<Runtime as bifrost_slp::Config>::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee(
RelayCurrencyId::get(),
XcmOperation::Chill,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
)
);

assert_ok!(Slp::set_xcm_dest_weight_and_fee(
RuntimeOrigin::root(),
RelayCurrencyId::get(),
XcmOperation::TransferBack,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
));
assert_ok!(
<Runtime as bifrost_slp::Config>::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee(
RelayCurrencyId::get(),
XcmOperation::TransferBack,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
)
);

// initialize two delegators
assert_ok!(Slp::initialize_delegator(RuntimeOrigin::root(), RelayCurrencyId::get(), None));
8 changes: 8 additions & 0 deletions integration-tests/bifrost-kusama/src/statemine.rs
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
use crate::{kusama_integration_tests::*, kusama_test_net::*};
use bifrost_asset_registry::AssetMetadata;
use frame_support::assert_ok;
use node_primitives::XcmInterfaceOperation as XcmOperation;
use polkadot_parachain::primitives::Sibling;
use sp_runtime::traits::AccountIdConversion;
use xcm::{
@@ -130,6 +131,13 @@ fn cross_usdt() {
&sp_runtime::AccountId32::from(ALICE),
10 * USDT
));

assert_ok!(XcmInterface::set_xcm_dest_weight_and_fee(
RelayCurrencyId::get(),
XcmOperation::StatemineTransfer,
Some((Weight::from_parts(10000000000, 1000000), 10_000_000_000)),
));

assert_ok!(XcmInterface::transfer_statemine_assets(
RuntimeOrigin::signed(ALICE.into()),
5 * USDT,
Loading

0 comments on commit e5513d7

Please sign in to comment.