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

pallet vesting / update to use fungible #1760

Closed
wants to merge 17 commits into from
Prev Previous commit
Next Next commit
Use default lock if can't decode
  • Loading branch information
gilescope committed Oct 2, 2023

Verified

This commit was signed with the committer’s verified signature.
commit 716e3db643d598030cf3ad254c8d41658bcc8648
2 changes: 1 addition & 1 deletion substrate/frame/vesting/src/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ fn add_locks<T: Config>(who: &T::AccountId, n: u8) {
let lock_id = T::BenchmarkHelper::freeze_id(id);
let locked = 256u32;
//TODO: what do we do with reasons?
let reasons = WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE;
// let reasons = WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE;
T::Currency::set_freeze(&lock_id, who, locked.into()).unwrap();
}
}
3 changes: 2 additions & 1 deletion substrate/frame/vesting/src/lib.rs
Original file line number Diff line number Diff line change
@@ -784,10 +784,11 @@ pub trait BenchmarkHelper<FreezeId> {
impl<T> BenchmarkHelper<T> for ()
where
T: Decode,
T: From<FreezeReason>,
{
/// Returns a frozen `Id` from a given integer.
fn freeze_id(id: u8) -> T {
let vec = vec![id];
T::decode(&mut vec.as_slice()).unwrap()
T::decode(&mut vec.as_slice()).unwrap_or(FreezeReason::NotYetVested.into())
}
}