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

[WIP] xtokens integrate delay-tasks to delay transfer_assets #981

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

wangjj9219
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 80.13857% with 86 lines in your changes are missing coverage. Please review.

Project coverage is 85.57%. Comparing base (7e05827) to head (5d8c7ff).
Report is 1 commits behind head on master.

❗ Current head 5d8c7ff differs from pull request most recent head face78f. Consider uploading reports for the commit face78f to get more accurate results

Files Patch % Lines
xtokens/src/lib.rs 35.36% 53 Missing ⚠️
delay-tasks/src/mock.rs 81.94% 13 Missing ⚠️
delay-tasks/src/lib.rs 82.35% 12 Missing ⚠️
asset-registry/src/mock/para.rs 0.00% 2 Missing ⚠️
xtokens/src/mock/para.rs 0.00% 2 Missing ⚠️
xtokens/src/mock/para_relative_view.rs 0.00% 2 Missing ⚠️
xtokens/src/mock/para_teleport.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #981      +/-   ##
==========================================
- Coverage   85.78%   85.57%   -0.21%     
==========================================
  Files          92       96       +4     
  Lines       11055    11475     +420     
==========================================
+ Hits         9483     9820     +337     
- Misses       1572     1655      +83     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}

impl<T: Config> Pallet<T> {
fn _on_finalize(now: BlockNumberFor<T>) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should do this with on_idle to be safer and we will know how many tasks to execute based on remaining weights

Copy link
Member

@xlc xlc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a lot of feature are similar to orml-authoirty, maybe we can just reuse it? e.g. for schedule and cancel task

I see two ways:
modifty orml-authority to use this pallet to do the scheduling code
or have orml-auhtoirty to implement some trait and have this pallet use it


/// A delayed origin. Can only be dispatched via `dispatch_as` with a delay.
#[derive(PartialEq, Eq, Clone, RuntimeDebug, Encode, Decode, TypeInfo, MaxEncodedLen)]
pub struct DelayedExecuteOrigin;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should try to reuse the one from orml-authority. we can move it to orml-utils

}
}

pub struct DelayedXtokensTaskHooks<T>(PhantomData<T>);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should avoid xcm/xtokens code in this pallet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants