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

feat: add rpc endpoint eth_getCode #162

Merged
merged 44 commits into from
Jul 18, 2024
Merged

feat: add rpc endpoint eth_getCode #162

merged 44 commits into from
Jul 18, 2024

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Jul 17, 2024

Based on #160

Motivation

Support rpc endpoint eth_getCode

Description

  • Add rpc endpoint eth_getCode
  • Add methods to obtain account code to Store api

Closes #38

@fmoletta fmoletta changed the base branch from main to eth_get_Balance July 17, 2024 20:50
@fmoletta fmoletta marked this pull request as ready for review July 17, 2024 21:01
@fmoletta fmoletta requested a review from a team as a code owner July 17, 2024 21:01
@@ -80,6 +83,15 @@ impl StoreEngine for Store {
fn get_block_number(&self, block_hash: BlockHash) -> Result<Option<BlockNumber>, StoreError> {
Ok(self.block_numbers.get(&block_hash).copied())
}

fn add_account_code(&mut self, code_hash: H256, code: Bytes) -> Result<(), StoreError> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: why don't we have to specify pub here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is part of a trait implementation, so it has the same visibility as the trait (which is public in this case)

Base automatically changed from eth_get_Balance to main July 18, 2024 15:52
@fmoletta fmoletta merged commit 591fbec into main Jul 18, 2024
3 checks passed
@fmoletta fmoletta deleted the eth_getCode branch July 18, 2024 16:01
mpaulucci pushed a commit to mpaulucci/lambda_ethereum_rust that referenced this pull request Oct 16, 2024
Based on lambdaclass#160 

**Motivation**

Support rpc endpoint `eth_getCode`

**Description**

* Add rpc endpoint `eth_getCode`
* Add methods to obtain account code to `Store` api
<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 -->

Closes lambdaclass#38
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.

Implement eth_getCode RPC endpoint
2 participants