forked from foundry-rs/foundry
-
Notifications
You must be signed in to change notification settings - Fork 6
anvil-polkadot: add genesis coinbase support #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
38315a0
anvil-polkadot: implement anvil_setCoinbase
iulianbarbu 2b27704
anvil-polkadot: added AURA based FindAuthor impl
iulianbarbu 8001624
anvil-polkadot: add eth_coinbase and tests
iulianbarbu 5656467
Merge branch 'master' into ib-add-genesis-coinbase-support
iulianbarbu 016801f
anvil-polkadot: polish code
iulianbarbu 93aed0f
anvil-polkadot: apply fmt
iulianbarbu b1552c4
anvil-polkadot(tests): test based on Multicall contract
iulianbarbu 628af56
anvil-polkadot(tests): adjust thresholds for timestamp tests on revert
iulianbarbu 85a1ac1
Merge branch 'master' into ib-add-genesis-coinbase-support
iulianbarbu b75dd8c
Update crates/anvil-polkadot/src/substrate_node/service/consensus.rs
iulianbarbu 4aa4559
anvil-polkadot: address feedback part 1
iulianbarbu 67c2819
anvil-polkadot: address feedback part 2
iulianbarbu ff3d218
anvil-polkadot: address feedback part 3
iulianbarbu c4060d3
anvil-polkadot: address feedback part 4
iulianbarbu 8da38fa
anvil-polkadot(tests): removed unnecessary sol call conversions
iulianbarbu dbab1e7
anvil-polkadot(tests): remove other redundant SollCall conversions
iulianbarbu 8a8d56d
anvil-polkadot: use Error::RuntimeApi
iulianbarbu 30d1503
Update crates/anvil-polkadot/src/substrate_node/service/consensus.rs
iulianbarbu af2eda8
update to polkadot-sdk master (#352)
alindima 8129cfe
Tracing support (#350)
pkhry d25535a
Revert "Tracing support (#350)"
iulianbarbu e63d18d
Revert "update to polkadot-sdk master (#352)"
iulianbarbu c8d6c14
Merge branch 'master' of github.com:paritytech/foundry-polkadot into …
iulianbarbu 1d672ab
anvil-polkadot(tests): fix test
iulianbarbu fbf1abc
anvil-polkadot: fix rustfmt
iulianbarbu 9d35a5b
anvil-polkadot: use pallet-aura FindAuthor todo comment
iulianbarbu c3451f6
Merge branch 'master' of github.com:paritytech/foundry-polkadot into …
iulianbarbu 3c79ad9
anvil-polkadot: address G feedback
iulianbarbu e8da020
Merge branch 'master' into ib-add-genesis-coinbase-support
iulianbarbu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
crates/anvil-polkadot/src/substrate_node/service/consensus.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| use polkadot_sdk::{ | ||
| sc_consensus::BlockImportParams, | ||
| sc_consensus_aura::CompatibleDigestItem, | ||
| sc_consensus_manual_seal::{ConsensusDataProvider, Error}, | ||
| sp_consensus_aura::ed25519::AuthoritySignature, | ||
| sp_consensus_babe::Slot, | ||
| sp_inherents::InherentData, | ||
| sp_runtime::{Digest, DigestItem, traits::Block as BlockT}, | ||
| }; | ||
| use std::marker::PhantomData; | ||
|
|
||
| /// Consensus data provider for Aura. | ||
iulianbarbu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
iulianbarbu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| pub struct SameSlotConsensusDataProvider<B, P> { | ||
| // slot duration | ||
iulianbarbu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| _phantom: PhantomData<(B, P)>, | ||
| } | ||
|
|
||
| impl<B, P> SameSlotConsensusDataProvider<B, P> { | ||
| pub fn new() -> Self { | ||
| Self { _phantom: PhantomData } | ||
| } | ||
| } | ||
|
|
||
| impl<B, P> ConsensusDataProvider<B> for SameSlotConsensusDataProvider<B, P> | ||
| where | ||
| B: BlockT, | ||
| P: Send + Sync, | ||
| { | ||
| type Proof = P; | ||
|
|
||
| fn create_digest( | ||
| &self, | ||
| _parent: &B::Header, | ||
| _inherents: &InherentData, | ||
| ) -> Result<Digest, Error> { | ||
| let digest_item = <DigestItem as CompatibleDigestItem<AuthoritySignature>>::aura_pre_digest( | ||
| Slot::default(), | ||
| ); | ||
|
|
||
| Ok(Digest { logs: vec![digest_item] }) | ||
| } | ||
|
|
||
| fn append_block_import( | ||
| &self, | ||
| _parent: &B::Header, | ||
| _params: &mut BlockImportParams<B>, | ||
| _inherents: &InherentData, | ||
| _proof: Self::Proof, | ||
| ) -> Result<(), Error> { | ||
| Ok(()) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.