Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Oct 31, 2024
1 parent ed481c3 commit 933d7f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

14 changes: 10 additions & 4 deletions ahm-controller/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ pub mod pallet {

#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
fn on_initialize(_: BlockNumberFor<T>) -> Weight {
fn on_initialize(now: BlockNumberFor<T>) -> Weight {
match T::Role::get() {
Role::Relay => {
Self::relay_on_init();
Self::relay_on_init(now);
},
Role::AssetHub => {
},
Expand All @@ -146,7 +146,11 @@ pub mod pallet {
}

impl<T: Config> Pallet<T> {
fn relay_on_init() {
fn relay_on_init(now: BlockNumberFor<T>) {
if now < 3u32.into() {
return;
}

// Phase init
let phase = match Phase::<T>::get() {
None => Phases::MigrateBalancesEds { next_account: None },
Expand Down Expand Up @@ -199,9 +203,11 @@ pub mod pallet {

fn do_migrate_eds(next_acc: Option<Vec<u8>>) -> Result<Option<Vec<u8>>, ()> {
frame_support::storage::transactional::with_transaction_opaque_err::<Option<Vec<u8>>, (), _>(|| {
let Some((next_key, call, weight)) = pallet_balances::Pallet::<T>::migrate_ed(next_acc, 100) else {
let Some((next_key, call, weight)) = pallet_balances::Pallet::<T>::migrate_ed(next_acc, 5000) else {
return TransactionOutcome::Commit(Ok(None));
};

// Issue: Inbound Downward message was too long

let ah_call: xcm::DoubleEncoded<()> = AssetHubPalletConfig::<T>::Balances(
call,
Expand Down

0 comments on commit 933d7f4

Please sign in to comment.