mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-23 17:28:23 +00:00
fix: pallet collective weights aliases (#337)
We have two instances of `pallet_collective` - `pallet_collective_treasury_council` - `pallet_collective_technical_committee` Our weights template automatically generates an implementation for `pallet_collective_treasury_council::WeightInfo` or `pallet_collective_technical_committee::WeightInfo`, which don't exist, making the compilation fail right after running benches. I created aliases for both pallet names, and added a small tweak to the template so it does not break anymore. --------- Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
This commit is contained in:
parent
207f2ff86a
commit
bd99fb7c4e
13 changed files with 31 additions and 27 deletions
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
use crate::{{pallet}};
|
||||
|
||||
/// Weights for `{{pallet}}`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
|
|
|
|||
|
|
@ -14,12 +14,6 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with DataHaven. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// TODO: Temporary workaround before upgrading to latest polkadot-sdk - fix https://github.com/paritytech/polkadot-sdk/pull/6435
|
||||
#[allow(unused_imports)]
|
||||
use pallet_collective as pallet_collective_treasury_council;
|
||||
#[allow(unused_imports)]
|
||||
use pallet_collective as pallet_collective_technical_committee;
|
||||
|
||||
frame_benchmarking::define_benchmarks!(
|
||||
// System benchmarks
|
||||
[frame_system, SystemBench::<Runtime>]
|
||||
|
|
|
|||
|
|
@ -27,11 +27,16 @@ mod benchmarks;
|
|||
pub mod configs;
|
||||
pub mod precompiles;
|
||||
pub mod weights;
|
||||
|
||||
// Re-export governance for tests
|
||||
pub use configs::governance;
|
||||
pub use configs::Precompiles;
|
||||
|
||||
// TODO: Temporary workaround before upgrading to latest polkadot-sdk - fix https://github.com/paritytech/polkadot-sdk/pull/6435
|
||||
#[allow(unused_imports)]
|
||||
use pallet_collective as pallet_collective_treasury_council;
|
||||
#[allow(unused_imports)]
|
||||
use pallet_collective as pallet_collective_technical_committee;
|
||||
|
||||
use alloc::{borrow::Cow, vec::Vec};
|
||||
use codec::Encode;
|
||||
use fp_rpc::TransactionStatus;
|
||||
|
|
|
|||
|
|
@ -51,10 +51,11 @@
|
|||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
use crate::pallet_collective_technical_committee;
|
||||
|
||||
/// Weights for `pallet_collective_technical_committee`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
|
||||
impl<T: frame_system::Config> pallet_collective_technical_committee::WeightInfo for WeightInfo<T> {
|
||||
/// Storage: `TechnicalCommittee::Members` (r:1 w:1)
|
||||
/// Proof: `TechnicalCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `TechnicalCommittee::Proposals` (r:1 w:0)
|
||||
|
|
|
|||
|
|
@ -51,10 +51,11 @@
|
|||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
use crate::pallet_collective_treasury_council;
|
||||
|
||||
/// Weights for `pallet_collective_treasury_council`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
|
||||
impl<T: frame_system::Config> pallet_collective_treasury_council::WeightInfo for WeightInfo<T> {
|
||||
/// Storage: `TreasuryCouncil::Members` (r:1 w:1)
|
||||
/// Proof: `TreasuryCouncil::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `TreasuryCouncil::Proposals` (r:1 w:0)
|
||||
|
|
|
|||
|
|
@ -14,12 +14,6 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with DataHaven. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// TODO: Temporary workaround before upgrading to latest polkadot-sdk - fix https://github.com/paritytech/polkadot-sdk/pull/6435
|
||||
#[allow(unused_imports)]
|
||||
use pallet_collective as pallet_collective_treasury_council;
|
||||
#[allow(unused_imports)]
|
||||
use pallet_collective as pallet_collective_technical_committee;
|
||||
|
||||
frame_benchmarking::define_benchmarks!(
|
||||
// System benchmarks
|
||||
[frame_system, SystemBench::<Runtime>]
|
||||
|
|
|
|||
|
|
@ -27,11 +27,16 @@ mod benchmarks;
|
|||
pub mod configs;
|
||||
pub mod precompiles;
|
||||
pub mod weights;
|
||||
|
||||
// Re-export governance for tests
|
||||
pub use configs::governance;
|
||||
pub use configs::Precompiles;
|
||||
|
||||
// TODO: Temporary workaround before upgrading to latest polkadot-sdk - fix https://github.com/paritytech/polkadot-sdk/pull/6435
|
||||
#[allow(unused_imports)]
|
||||
use pallet_collective as pallet_collective_treasury_council;
|
||||
#[allow(unused_imports)]
|
||||
use pallet_collective as pallet_collective_technical_committee;
|
||||
|
||||
use alloc::{borrow::Cow, vec::Vec};
|
||||
use codec::Encode;
|
||||
use fp_rpc::TransactionStatus;
|
||||
|
|
|
|||
|
|
@ -51,10 +51,11 @@
|
|||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
use crate::pallet_collective_technical_committee;
|
||||
|
||||
/// Weights for `pallet_collective_technical_committee`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
|
||||
impl<T: frame_system::Config> pallet_collective_technical_committee::WeightInfo for WeightInfo<T> {
|
||||
/// Storage: `TechnicalCommittee::Members` (r:1 w:1)
|
||||
/// Proof: `TechnicalCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `TechnicalCommittee::Proposals` (r:1 w:0)
|
||||
|
|
|
|||
|
|
@ -51,10 +51,11 @@
|
|||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
use crate::pallet_collective_treasury_council;
|
||||
|
||||
/// Weights for `pallet_collective_treasury_council`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
|
||||
impl<T: frame_system::Config> pallet_collective_treasury_council::WeightInfo for WeightInfo<T> {
|
||||
/// Storage: `TreasuryCouncil::Members` (r:1 w:1)
|
||||
/// Proof: `TreasuryCouncil::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `TreasuryCouncil::Proposals` (r:1 w:0)
|
||||
|
|
|
|||
|
|
@ -14,13 +14,6 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with DataHaven. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// TODO: Temporary workaround before upgrading to latest polkadot-sdk - fix https://github.com/paritytech/polkadot-sdk/pull/6435
|
||||
#[allow(unused_imports)]
|
||||
use pallet_collective as pallet_collective_treasury_council;
|
||||
#[allow(unused_imports)]
|
||||
use pallet_collective as pallet_collective_technical_committee;
|
||||
use pallet_external_validator_slashes as pallet_external_validators_slashes;
|
||||
|
||||
frame_benchmarking::define_benchmarks!(
|
||||
// System benchmarks
|
||||
[frame_system, SystemBench::<Runtime>]
|
||||
|
|
|
|||
|
|
@ -31,6 +31,12 @@ pub mod weights;
|
|||
pub use configs::governance;
|
||||
pub use configs::Precompiles;
|
||||
|
||||
// TODO: Temporary workaround before upgrading to latest polkadot-sdk - fix https://github.com/paritytech/polkadot-sdk/pull/6435
|
||||
#[allow(unused_imports)]
|
||||
use pallet_collective as pallet_collective_treasury_council;
|
||||
#[allow(unused_imports)]
|
||||
use pallet_collective as pallet_collective_technical_committee;
|
||||
|
||||
use alloc::{borrow::Cow, vec::Vec};
|
||||
use codec::Encode;
|
||||
use fp_rpc::TransactionStatus;
|
||||
|
|
|
|||
|
|
@ -51,10 +51,11 @@
|
|||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
use crate::pallet_collective_technical_committee;
|
||||
|
||||
/// Weights for `pallet_collective_technical_committee`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
|
||||
impl<T: frame_system::Config> pallet_collective_technical_committee::WeightInfo for WeightInfo<T> {
|
||||
/// Storage: `TechnicalCommittee::Members` (r:1 w:1)
|
||||
/// Proof: `TechnicalCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `TechnicalCommittee::Proposals` (r:1 w:0)
|
||||
|
|
|
|||
|
|
@ -51,10 +51,11 @@
|
|||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
use crate::pallet_collective_treasury_council;
|
||||
|
||||
/// Weights for `pallet_collective_treasury_council`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> pallet_collective::WeightInfo for WeightInfo<T> {
|
||||
impl<T: frame_system::Config> pallet_collective_treasury_council::WeightInfo for WeightInfo<T> {
|
||||
/// Storage: `TreasuryCouncil::Members` (r:1 w:1)
|
||||
/// Proof: `TreasuryCouncil::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `TreasuryCouncil::Proposals` (r:1 w:0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue