Allow multiple bounds to be specified at decl_error! (#7448)

* Allow multiple bounds to be specified at decl_error!

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Test if decl_error! accepts multiple bounds

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Alexander Theißen
2020-10-28 15:46:08 +01:00
committed by GitHub
parent 9687759774
commit 9bfaf451a7
2 changed files with 13 additions and 8 deletions
@@ -39,6 +39,7 @@ pub trait Currency {}
// * Origin, Inherent, Event
mod module1 {
use super::*;
use sp_std::ops::Add;
pub trait Trait<I>: system::Trait where <Self as system::Trait>::BlockNumber: From<u32> {
type Event: From<Event<Self, I>> + Into<<Self as system::Trait>::Event>;
@@ -82,7 +83,11 @@ mod module1 {
}
frame_support::decl_error! {
pub enum Error for Module<T: Trait<I>, I: Instance> where T::BlockNumber: From<u32> {
pub enum Error for Module<T: Trait<I>, I: Instance> where
T::BlockNumber: From<u32>,
T::BlockNumber: Add,
T::AccountId: AsRef<[u8]>,
{
/// Test
Test,
}