mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Per-transaction weight for srml (#2799)
* debug checkpoint. * new * Worked. * Worked and weight propagated to executive. * Works with some tests. * Cleanup debug prints. * More cleanup. * Undo more logs. * Undo a few more. * Fix build. * Allow len to be used in weight calculation. * Remove noop function from dispath. * Cleanup. * Unify traits. * Update docs and nits. * line width * Update core/sr-primitives/src/weights.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Update core/sr-primitives/src/weights.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Update core/sr-primitives/src/weights.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Update core/sr-primitives/src/weights.rs Co-Authored-By: Amar Singh <asinghchrony@protonmail.com> * Update srml/example/src/lib.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Final cleanup. * Fix build.
This commit is contained in:
@@ -20,6 +20,7 @@ use serde::{Serialize, Serializer, Deserialize, de::Error as DeError, Deserializ
|
||||
use std::{fmt::Debug, ops::Deref, fmt};
|
||||
use crate::codec::{Codec, Encode, Decode};
|
||||
use crate::traits::{self, Checkable, Applyable, BlakeTwo256, Convert};
|
||||
use crate::weights::{Weighable, Weight};
|
||||
use crate::generic::DigestItem as GenDigestItem;
|
||||
pub use substrate_primitives::H256;
|
||||
use substrate_primitives::U256;
|
||||
@@ -239,3 +240,9 @@ impl<Call> Applyable for TestXt<Call> where
|
||||
(self.2, self.0)
|
||||
}
|
||||
}
|
||||
impl<Call> Weighable for TestXt<Call> {
|
||||
fn weight(&self, len: usize) -> Weight {
|
||||
// for testing: weight == size.
|
||||
len as Weight
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user