Fungibles trait and impl for Assets pallet#8425
Conversation
|
cc @s3krit |
|
|
||
| let ln2 = { | ||
| let ln2 = P::from_rational(LN2.deconstruct().into(), Perquintill::ACCURACY.into()); | ||
| /// `ln(2)` expressed in as perquintillionth. |
There was a problem hiding this comment.
Just some minor refactoring to more tightly scope the const.
| if dest == source || amount.is_zero() { | ||
| return Ok(()) | ||
| } | ||
| if dest != source && !amount.is_zero() { |
There was a problem hiding this comment.
Need to condition this across most of the function since I moved the deposit_event into here.
| id: T::AssetId, | ||
| source: &T::AccountId, | ||
| dest: &T::AccountId, | ||
| source: T::AccountId, |
There was a problem hiding this comment.
Needed to avoid a clone on deposit_event now it's in here.
| let origin = ensure_signed(origin)?; | ||
| let beneficiary = T::Lookup::lookup(beneficiary)?; | ||
|
|
||
| Asset::<T>::try_mutate(id, |maybe_details| { |
There was a problem hiding this comment.
Moved into a utility function so it can be shared with the Fungibles impl.
s3krit
left a comment
There was a problem hiding this comment.
CI/label changes look good
frame/staking/reward-fn/src/lib.rs
Outdated
| falloff: P, | ||
| ) -> P { | ||
| if stake < ideal_stake { | ||
| if stake <= ideal_stake { |
There was a problem hiding this comment.
@thiolliere this really should be a trivial optimisation, but tests fail with the change.
There was a problem hiding this comment.
because test are testing for ideal_stake from 0 to 1, when ideal_stake is 0 we should modify the division below into a checked_div, or do a special case in some way
* Fungibles trait and impl for Assets pallet * Comment & whitespace * Fixes * Fix up CI/CD for the new labels. * New labels. * Fix labels * Fix labels * Whitespace * Bump impl version. * Fix accidental change * Fixes * Questionable fix. * Better benchmark
This is needed for the XCM integrations for the Assets pallet.
This also includes some minor alterations to CI mainly for the renaming of a few of the labels.