mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 20:57:59 +00:00
contracts: Allow contracts to dispatch calls into the runtime (#9276)
* contracts: Allow contracts to dispatch calls into the runtime * Fix RPC tests * Fix typo * Replace () by AllowAllFilter and DenyAllFilter * Add rust doc * Fixup for `()` removal * Fix lowest gas calculation * Rename AllowAllFilter and DenyAllFilter * Updated changelog
This commit is contained in:
committed by
GitHub
parent
2f31602896
commit
e01ac8cea0
@@ -2684,7 +2684,7 @@ mod tests {
|
||||
type Origin = OuterOrigin;
|
||||
type AccountId = u32;
|
||||
type Call = ();
|
||||
type BaseCallFilter = ();
|
||||
type BaseCallFilter = frame_support::traits::AllowAll;
|
||||
type BlockNumber = u32;
|
||||
type PalletInfo = Self;
|
||||
type DbWeight = ();
|
||||
|
||||
@@ -45,6 +45,7 @@ pub use validation::{
|
||||
mod filter;
|
||||
pub use filter::{
|
||||
Filter, FilterStack, FilterStackGuard, ClearFilterGuard, InstanceFilter, IntegrityTest,
|
||||
AllowAll, DenyAll,
|
||||
};
|
||||
|
||||
mod misc;
|
||||
|
||||
@@ -25,10 +25,20 @@ pub trait Filter<T> {
|
||||
fn filter(_: &T) -> bool;
|
||||
}
|
||||
|
||||
impl<T> Filter<T> for () {
|
||||
/// A [`Filter`] that allows any value.
|
||||
pub enum AllowAll {}
|
||||
|
||||
/// A [`Filter`] that denies any value.
|
||||
pub enum DenyAll {}
|
||||
|
||||
impl<T> Filter<T> for AllowAll {
|
||||
fn filter(_: &T) -> bool { true }
|
||||
}
|
||||
|
||||
impl<T> Filter<T> for DenyAll {
|
||||
fn filter(_: &T) -> bool { false }
|
||||
}
|
||||
|
||||
/// Trait to add a constraint onto the filter.
|
||||
pub trait FilterStack<T>: Filter<T> {
|
||||
/// The type used to archive the stack.
|
||||
|
||||
Reference in New Issue
Block a user