mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 07:01:05 +00:00
Explicitly note that existing AccountIdConversion is truncating and add fallible try_into... (#10719)
* note truncating, add fallible try_into * fmt * migrate all to `truncating` * typo * uno mas * Update primitives/runtime/src/traits.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * check the bytes before and after are sensible * fmt * Update lib.rs * Update primitives/runtime/src/traits.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -799,14 +799,14 @@ impl<T: Config> Pallet<T> {
|
||||
/// This actually does computation. If you need to keep using it, then make sure you cache the
|
||||
/// value and only call this once.
|
||||
pub fn account_id() -> T::AccountId {
|
||||
T::PalletId::get().into_account()
|
||||
T::PalletId::get().into_account_truncating()
|
||||
}
|
||||
|
||||
/// The account ID of a bounty account
|
||||
pub fn bounty_account_id(id: BountyIndex) -> T::AccountId {
|
||||
// only use two byte prefix to support 16 byte account id (used by test)
|
||||
// "modl" ++ "py/trsry" ++ "bt" is 14 bytes, and two bytes remaining for bounty index
|
||||
T::PalletId::get().into_sub_account(("bt", id))
|
||||
T::PalletId::get().into_sub_account_truncating(("bt", id))
|
||||
}
|
||||
|
||||
fn create_bounty(
|
||||
|
||||
@@ -786,7 +786,7 @@ impl<T: Config> Pallet<T> {
|
||||
// This function is taken from the parent (bounties) pallet, but the
|
||||
// prefix is changed to have different AccountId when the index of
|
||||
// parent and child is same.
|
||||
T::PalletId::get().into_sub_account(("cb", id))
|
||||
T::PalletId::get().into_sub_account_truncating(("cb", id))
|
||||
}
|
||||
|
||||
fn create_child_bounty(
|
||||
|
||||
@@ -389,7 +389,7 @@ impl<T: Config> Pallet<T> {
|
||||
/// This actually does computation. If you need to keep using it, then make sure you cache the
|
||||
/// value and only call this once.
|
||||
pub fn account_id() -> T::AccountId {
|
||||
T::PalletId::get().into_account()
|
||||
T::PalletId::get().into_account_truncating()
|
||||
}
|
||||
|
||||
/// Return the pot account and amount of money in the pot.
|
||||
|
||||
@@ -2018,14 +2018,14 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
/// Create the main, bonded account of a pool with the given id.
|
||||
pub fn create_bonded_account(id: PoolId) -> T::AccountId {
|
||||
T::PalletId::get().into_sub_account((AccountType::Bonded, id))
|
||||
T::PalletId::get().into_sub_account_truncating((AccountType::Bonded, id))
|
||||
}
|
||||
|
||||
/// Create the reward account of a pool with the given id.
|
||||
pub fn create_reward_account(id: PoolId) -> T::AccountId {
|
||||
// NOTE: in order to have a distinction in the test account id type (u128), we put
|
||||
// account_type first so it does not get truncated out.
|
||||
T::PalletId::get().into_sub_account((AccountType::Reward, id))
|
||||
T::PalletId::get().into_sub_account_truncating((AccountType::Reward, id))
|
||||
}
|
||||
|
||||
/// Get the member with their associated bonded and reward pool.
|
||||
|
||||
@@ -1726,7 +1726,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
/// This actually does computation. If you need to keep using it, then make sure you cache the
|
||||
/// value and only call this once.
|
||||
pub fn account_id() -> T::AccountId {
|
||||
T::PalletId::get().into_account()
|
||||
T::PalletId::get().into_account_truncating()
|
||||
}
|
||||
|
||||
/// The account ID of the payouts pot. This is where payouts are made from.
|
||||
@@ -1734,7 +1734,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
/// This actually does computation. If you need to keep using it, then make sure you cache the
|
||||
/// value and only call this once.
|
||||
pub fn payouts() -> T::AccountId {
|
||||
T::PalletId::get().into_sub_account(b"payouts")
|
||||
T::PalletId::get().into_sub_account_truncating(b"payouts")
|
||||
}
|
||||
|
||||
/// Return the duration of the lock, in blocks, with the given number of members.
|
||||
|
||||
@@ -467,7 +467,7 @@ impl<T: Config> Pallet<T> {
|
||||
/// This actually does computation. If you need to keep using it, then make sure you cache the
|
||||
/// value and only call this once.
|
||||
pub fn account_id() -> T::AccountId {
|
||||
T::PalletId::get().into_account()
|
||||
T::PalletId::get().into_account_truncating()
|
||||
}
|
||||
|
||||
/// Given a mutable reference to an `OpenTip`, insert the tip into it and check whether it
|
||||
|
||||
@@ -437,7 +437,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
/// This actually does computation. If you need to keep using it, then make sure you cache the
|
||||
/// value and only call this once.
|
||||
pub fn account_id() -> T::AccountId {
|
||||
T::PalletId::get().into_account()
|
||||
T::PalletId::get().into_account_truncating()
|
||||
}
|
||||
|
||||
/// The needed bond for a proposal whose spend is `value`.
|
||||
|
||||
Reference in New Issue
Block a user