@@ -820,7 +820,7 @@ impl<O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>, Acco
820820}
821821
822822pub struct EnsureSigned < AccountId > ( sp_std:: marker:: PhantomData < AccountId > ) ;
823- impl < O : Into < Result < RawOrigin < AccountId > , O > > + From < RawOrigin < AccountId > > , AccountId : Default >
823+ impl < O : Into < Result < RawOrigin < AccountId > , O > > + From < RawOrigin < AccountId > > , AccountId : Decode >
824824 EnsureOrigin < O > for EnsureSigned < AccountId >
825825{
826826 type Success = AccountId ;
@@ -833,15 +833,18 @@ impl<O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>, Acco
833833
834834 #[ cfg( feature = "runtime-benchmarks" ) ]
835835 fn successful_origin ( ) -> O {
836- O :: from ( RawOrigin :: Signed ( Default :: default ( ) ) )
836+ let zero_account_id =
837+ AccountId :: decode ( & mut sp_runtime:: traits:: TrailingZeroInput :: zeroes ( ) )
838+ . expect ( "infinite length input; no invalid inputs for type; qed" ) ;
839+ O :: from ( RawOrigin :: Signed ( zero_account_id) )
837840 }
838841}
839842
840843pub struct EnsureSignedBy < Who , AccountId > ( sp_std:: marker:: PhantomData < ( Who , AccountId ) > ) ;
841844impl <
842845 O : Into < Result < RawOrigin < AccountId > , O > > + From < RawOrigin < AccountId > > ,
843846 Who : SortedMembers < AccountId > ,
844- AccountId : PartialEq + Clone + Ord + Default ,
847+ AccountId : PartialEq + Clone + Ord + Decode ,
845848 > EnsureOrigin < O > for EnsureSignedBy < Who , AccountId >
846849{
847850 type Success = AccountId ;
@@ -854,10 +857,13 @@ impl<
854857
855858 #[ cfg( feature = "runtime-benchmarks" ) ]
856859 fn successful_origin ( ) -> O {
860+ let zero_account_id =
861+ AccountId :: decode ( & mut sp_runtime:: traits:: TrailingZeroInput :: zeroes ( ) )
862+ . expect ( "infinite length input; no invalid inputs for type; qed" ) ;
857863 let members = Who :: sorted_members ( ) ;
858864 let first_member = match members. get ( 0 ) {
859865 Some ( account) => account. clone ( ) ,
860- None => Default :: default ( ) ,
866+ None => zero_account_id ,
861867 } ;
862868 O :: from ( RawOrigin :: Signed ( first_member. clone ( ) ) )
863869 }
0 commit comments