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

Sys 4061 treasury spend tracks #412

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

ivan-cholakov
Copy link
Contributor

@ivan-cholakov ivan-cholakov commented Jun 4, 2024

Proposed changes

  • Added Treasury Spender tracks and origins,
  • modified the extrinsic in the TokenManager pallet to check for the new origins

Type of change/Merge

🚨What type of change is this PR?

Put an x in the boxes that apply

  • Release
    • Increase versions
    • Baseline tests passed
    • Release type:
      • Major release
      • Minor release
      • Patch release

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • You describe the purpose of the PR, e.g.:
    • What does it do?
    • Highlight what important points reviewers should know about;
    • Indicates if there is something left for follow-up PRs.
  • Documentation updated
  • Business logic tested successfully
  • Verify First, Write Last: In Substrate development, it is important that you always ensure preconditions are met and return errors at the beginning. After these checks have completed, then you may begin the function's computation.

Further comments

@ivan-cholakov ivan-cholakov force-pushed the SYS-4061-treasury-spend-tracks branch from 530fec6 to 2d76e35 Compare June 4, 2024 14:43
runtime/avn/src/governance/mod.rs Outdated Show resolved Hide resolved
@@ -39,7 +39,16 @@ const APP_WHITELISTED_CALLER: Curve =
const SUP_WHITELISTED_CALLER: Curve =
Curve::make_reciprocal(1, 28, percent(20), percent(5), percent(50));

const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 5] = [
const APP_SMALL_SPENDER: Curve = Curve::make_linear(17, 28, percent(50), percent(100));
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these similar to Polkadot?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, exactly the same

runtime/avn/src/governance/tracks.rs Show resolved Hide resolved
@@ -72,4 +80,45 @@ pub mod pallet_custom_origins {
() => {}
}
decl_unit_ensures!(GeneralAdmin, ReferendumCanceller, ReferendumKiller, WhitelistedCaller,);

macro_rules! decl_ensure {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@ivan-cholakov ivan-cholakov force-pushed the SYS-4061-treasury-spend-tracks branch from be65145 to 77577c6 Compare June 5, 2024 08:42
@ivan-cholakov ivan-cholakov force-pushed the SYS-4061-treasury-spend-tracks branch from a0cd896 to 1d4db66 Compare June 5, 2024 08:56
@ivan-cholakov ivan-cholakov force-pushed the SYS-4061-treasury-spend-tracks branch from ff17184 to 8401799 Compare June 5, 2024 09:59
@ivan-cholakov ivan-cholakov force-pushed the SYS-4061-treasury-spend-tracks branch from 62c9a09 to 2da0e31 Compare June 5, 2024 10:05
@ivan-cholakov ivan-cholakov force-pushed the SYS-4061-treasury-spend-tracks branch from 9505e3e to 155a790 Compare June 6, 2024 11:57
Comment on lines +118 to +119
SmallSpender = 1000 * AVT,
MediumSpender = 1000 * AVT,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these meant to be the same value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Didn't notice it. Thanks

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.

4 participants