forked from foundry-rs/foundry
-
Notifications
You must be signed in to change notification settings - Fork 6
anvil-polkadot: add chain reversion RPCs #336
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 28 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
d1ae4c4
anvil-polkadot: add snapshot manager & evm snapshot RPC
iulianbarbu 22d3d36
cargo: format toml & lock
iulianbarbu afcadaa
Revert "cargo: format toml & lock"
iulianbarbu 2725161
evm_revert: wip debug test failure
iulianbarbu 486d13d
anvil-polkadot: seal best blocks only
iulianbarbu 6707ca8
anvil-polkadot: test snapshot and revert
iulianbarbu f3376ab
tomls: update formatting and polkadot-sdk dep
iulianbarbu 6728dc5
anvil-polkadot: revert uneeded changes
iulianbarbu 22050bf
Merge branch 'master' of github.com:paritytech/foundry-polkadot into …
iulianbarbu 877fff8
Update crates/revive-env/Cargo.toml
iulianbarbu aaba52f
Update crates/revive-strategy/Cargo.toml
iulianbarbu bbc1731
anvil-polkadot: update block provider best block after revert
iulianbarbu 43b980f
anvil-polkadot: set db pruning to archive
iulianbarbu 9b1deca
anvil-polkadot: impl rollback & add tests
iulianbarbu d8098d1
anvil-polkadot(tests): add todos for block provider testing
iulianbarbu 5b32dc1
anvil-polkadot(tests): finalize existing tests
iulianbarbu c93d1ae
anvil-polkadot: update evm_revert & anvil-rollback return type
iulianbarbu 3d46f1e
anvil-polkadot(tests): add revert and txs in mempool test
iulianbarbu a3b01e2
anvil-polkadot: code polish
iulianbarbu 0f720de
Merge branch 'master' of github.com:paritytech/foundry-polkadot into …
iulianbarbu 63a25f9
anvil-polkadot(tests): fix timestmap with evm revert test
iulianbarbu e6173bd
anvil-polkadot(tests): final polish
iulianbarbu 37debaa
anvil-polkadot: remove leftovers
iulianbarbu b5b641b
Merge branch 'master' of github.com:paritytech/foundry-polkadot into …
iulianbarbu dcacce6
anvil-polkadot: fix merge issues
iulianbarbu b9ad0f0
anvil-polkadot: simplify time updating after revert
iulianbarbu 75599db
anvil-polkadot: remove extra timestamp setting in storage
iulianbarbu 9801c35
Merge branch 'master' of github.com:paritytech/foundry-polkadot into …
iulianbarbu dbb8204
anvil-polkadot: address leftovers after merge
iulianbarbu 4b5e922
Apply suggestion from @iulianbarbu
iulianbarbu cd2dbd8
Apply suggestion from @iulianbarbu
iulianbarbu 0b99c7d
anvil-polkadot: revert new backend error variants
iulianbarbu 4e7b0cc
Update crates/anvil-polkadot/src/substrate_node/service/backend.rs
iulianbarbu 22984b0
anvil-polkadot: address feedback
iulianbarbu 6f56dc4
Update crates/anvil-polkadot/src/substrate_node/snapshot.rs
iulianbarbu 04b5f0b
Update crates/anvil-polkadot/src/substrate_node/snapshot.rs
iulianbarbu 4f0aa31
anvil-polkadot(tests): address feedback
iulianbarbu aab7fa5
Merge branch 'master' into ib-add-chain-reversion
iulianbarbu fb484e0
anvil-polkadot(tests): fix merge issue
iulianbarbu 6e56070
anvil-polkadot: address feedback
iulianbarbu 2b6fc22
anvil-polkadot(tests): simplify evm_snapshot result assert
iulianbarbu b57c04f
doc: fix clippy
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
Large diffs are not rendered by default.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,7 @@ | ||
| use crate::substrate_node::{mining_engine::MiningError, service::BackendError}; | ||
| use anvil_rpc::{error::RpcError, response::ResponseResult}; | ||
| use polkadot_sdk::{ | ||
| pallet_revive_eth_rpc::{EthRpcError, client::ClientError}, | ||
| sp_api, | ||
| }; | ||
| use pallet_revive_eth_rpc::{EthRpcError, client::ClientError}; | ||
| use polkadot_sdk::sp_api; | ||
| use serde::Serialize; | ||
|
|
||
| #[derive(Debug, thiserror::Error)] | ||
|
|
@@ -16,6 +14,10 @@ pub enum Error { | |
| InvalidParams(String), | ||
| #[error("Revive call failed: {0}")] | ||
| ReviveRpc(#[from] EthRpcError), | ||
| #[error("Snapshot error: {0}")] | ||
| SnapshotRpc(String), | ||
| #[error("Subxt error: {0}")] | ||
| Subxt(#[from] subxt::error::Error), | ||
| #[error(transparent)] | ||
| Backend(#[from] BackendError), | ||
| #[error("Nonce overflowing the substrate nonce type")] | ||
|
|
@@ -28,12 +30,6 @@ pub enum Error { | |
| InternalError(String), | ||
| } | ||
|
|
||
| impl From<subxt::Error> for Error { | ||
| fn from(err: subxt::Error) -> Self { | ||
| Self::ReviveRpc(EthRpcError::ClientError(err.into())) | ||
| } | ||
| } | ||
|
Comment on lines
31
to
35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added this back since I also removed the |
||
|
|
||
| impl From<ClientError> for Error { | ||
| fn from(err: ClientError) -> Self { | ||
| Self::ReviveRpc(EthRpcError::ClientError(err)) | ||
|
|
@@ -83,6 +79,13 @@ impl<T: Serialize> ToRpcResponseResult for Result<T> { | |
| Error::InvalidParams(error_message) => { | ||
| RpcError::invalid_params(error_message).into() | ||
| } | ||
| Error::SnapshotRpc(err) => RpcError::internal_error_with(err).into(), | ||
| Error::ReviveRpc(client_error) => { | ||
| RpcError::internal_error_with(format!("{client_error}")).into() | ||
| } | ||
| Error::Subxt(subxt_err) => { | ||
| RpcError::internal_error_with(format!("{subxt_err}")).into() | ||
| } | ||
iulianbarbu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| err => RpcError::internal_error_with(format!("{err}")).into(), | ||
| }, | ||
| } | ||
|
|
||
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.