Skip to content

Commit 43aacf4

Browse files
committed
evm: FindAuthor using Authorship
1 parent 771744f commit 43aacf4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

standalone/runtime/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,15 +1595,15 @@ impl pallet_evm_account_mapping::Config for Runtime {
15951595

15961596
impl pallet_evm_chain_id::Config for Runtime {}
15971597

1598-
pub struct TruncatedTreasuryAsAuthor;
1599-
impl FindAuthor<H160> for TruncatedTreasuryAsAuthor {
1598+
pub struct FindAuthorTruncated;
1599+
impl FindAuthor<H160> for FindAuthorTruncated {
16001600
fn find_author<'a, I>(_digests: I) -> Option<H160>
16011601
where
16021602
I: 'a + IntoIterator<Item = (ConsensusEngineId, &'a [u8])>,
16031603
{
1604-
let treasury = Treasury::account_id();
1605-
let raw_auth_id: &[u8] = treasury.as_ref();
1606-
return Some(H160::from_slice(&raw_auth_id[..20]));
1604+
let author = Authorship::author()?;
1605+
let raw_auth_id: &[u8] = author.as_ref();
1606+
Some(H160::from_slice(&raw_auth_id[..20]))
16071607
}
16081608
}
16091609

@@ -1669,7 +1669,7 @@ impl pallet_evm::Config for Runtime {
16691669
type Runner = pallet_evm::runner::stack::Runner<Self>;
16701670
type OnChargeTransaction = EvmDealWithFees;
16711671
type OnCreate = ();
1672-
type FindAuthor = TruncatedTreasuryAsAuthor;
1672+
type FindAuthor = FindAuthorTruncated;
16731673
type GasLimitPovSizeRatio = GasLimitPovSizeRatio;
16741674
type SuicideQuickClearLimit = SuicideQuickClearLimit;
16751675
type Timestamp = Timestamp;

0 commit comments

Comments
 (0)