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_getBalance #160

Merged
merged 39 commits into from
Jul 18, 2024
Merged

feat: add rpc endpoint eth_getBalance #160

merged 39 commits into from
Jul 18, 2024

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Jul 17, 2024

Based on #145

Motivation

Support rpc endpoint eth_getBalance
Description

Add rpc endpoint eth_getBalance

Closes #36

@fmoletta fmoletta changed the base branch from main to get_block_by_number July 17, 2024 18:23
@fmoletta fmoletta marked this pull request as ready for review July 17, 2024 18:29
@fmoletta fmoletta requested a review from a team as a code owner July 17, 2024 18:29
}

impl GetBalanceRequest {
pub fn parse(params: &Option<Vec<Value>>) -> Option<GetBalanceRequest> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

any reason why this returns Option instead of Result? Not against it, just curious

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All failure cases lead to a RpcError::BadParams error, by returning an Option we can omit all the repeated error mapping and just map once where the function is called. We could also use an internal function and make parse return the RpcError::BadParams

Base automatically changed from get_block_by_number to main July 18, 2024 13:10
@fmoletta fmoletta merged commit 6cbde32 into main Jul 18, 2024
3 checks passed
@fmoletta fmoletta deleted the eth_get_Balance branch July 18, 2024 15:52
fmoletta added a commit that referenced this pull request Jul 18, 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
<!-- A clear and concise general description of the changes this PR
introduces -->

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

Closes #38
mpaulucci pushed a commit to mpaulucci/lambda_ethereum_rust that referenced this pull request Oct 16, 2024
Based on lambdaclass#145 

**Motivation**

Support rpc endpoint `eth_getBalance`
**Description**

Add rpc endpoint `eth_getBalance`

<!-- A clear and concise general description of the changes this PR
introduces -->

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

Closes lambdaclass#36
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_getBalance RPC endpoint
2 participants