Skip to content
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

[MOON-2092] Implement call state override for eth_call #163

Open
wants to merge 11 commits into
base: moonbeam-polkadot-v0.9.37
Choose a base branch
from

Conversation

nbaztec
Copy link

@nbaztec nbaztec commented Mar 7, 2023

Implements call state override for eth_call.

@nbaztec nbaztec marked this pull request as ready for review March 13, 2023 14:04
B: BlockT,
C: StorageProvider<B, sc_service::TFullBackend<B>>,
{
type AddressMapping = M;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The presence of different address schemes introduces another generic parameter M to most of the service build code. We have the option to mark it as concrete in the EthDeps config struct to avoid that.

@nbaztec nbaztec changed the title [MOON-2092] Implement call state override for eth_call (WIP) [MOON-2092] Implement call state override for eth_call Mar 13, 2023
/// Implements a default runtime storage override.
/// It assumes that the balances and nonces are stored in pallet `system.account`, and
/// have `nonce: Index` = `u32` for and `free: Balance` = `u128`.
pub struct DefaultEthereumRuntimeStorageOverride<M>(pub std::marker::PhantomData<M>);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This default may or may not be super useful as we ourselves are using AccountId20 while frontier is targetting AccountId32. The basic pallet system override might be trivial to copy paste from the template instead.

Copy link

@librelois librelois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, looks good to me, we just need to mimic the geth rpc api

template/node/src/rpc/eth.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants