-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add dynamic BurnParameters
for Kusama Treasury
#511
base: main
Are you sure you want to change the base?
Add dynamic BurnParameters
for Kusama Treasury
#511
Conversation
…v can decide on Burn parameters for Kusama Treasury.
bc40137
to
db30521
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pandres95 can you please add some tests?
…eparate values, to be more ergonomic with `set_parameters` usage. Note: while `BurnDestinationAccount` is not as ergonomic since it comprises of an `Option<AccountId>` value, it's more ergonomic than comparing against an arbitrary `AccountId::from([0u8; 32])`. Note 2: The `BurnDestinationAccount` wrapper is unfortunately necessary, as explicitly stating `AccountId` failed. Need to report an issue on PSDK about this.
0f10245
to
d24ea09
Compare
@acatangiu tests are ready |
relay/kusama/src/lib.rs
Outdated
let account = account.0.expect("given `account.0.is_some`; qed"); | ||
// Must resolve into existing but better to be safe. | ||
Balances::resolve_creating(&account, amount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can refactor to avoid the expect
:
let account = account.0.expect("given `account.0.is_some`; qed"); | |
// Must resolve into existing but better to be safe. | |
Balances::resolve_creating(&account, amount); | |
if let Some(account) = account.0.as_ref() { | |
// Must resolve into existing but better to be safe. | |
Balances::resolve_creating(account, amount); | |
} |
no need for else branch since you know it will always be Some
This Pull Request resolves the signal raised by the Kusama Ref. #437, setting both
Burn
andBurnDestination
parameters in Kusama'spallet-treasury
as a structure (both of them need to be set to prevent some unwanted behaviour) that can be parametrized via OpenGov.Default (when set to
None
) configuration behaves like what's already out there: 0%, no account.