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

Implement Fluffy JSON-RPC endpoints. #2364

Merged
merged 2 commits into from
Jun 14, 2024
Merged

Conversation

web3-developer
Copy link
Contributor

@web3-developer web3-developer commented Jun 14, 2024

JSON-RPC endpoints implemented:

  • eth_getBalance
  • eth_getTransactionCount
  • eth_getStorageAt
  • eth_getCode

Tests will be added in a future PR.

@web3-developer web3-developer changed the title Implement JSON-RPC endpoints that use state network data. Implement Fluffy JSON-RPC endpoints. Jun 14, 2024
raise newException(ValueError, error)

balance = (await stateNetwork.get().getBalance(blockHash, data.EthAddress)).valueOr:
# Should we return 0 here or throw a more detailed error?
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand it right, there are many errors that can occur here and it would be difficult to be certain that the account simply doesn't exist (and thus return 0).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that was my thought as well.

nonce = (
await stateNetwork.get().getTransactionCount(blockHash, data.EthAddress)
).valueOr:
# Should we return 0 here or throw a more detailed error?
Copy link
Contributor

Choose a reason for hiding this comment

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

idem ^

@web3-developer web3-developer merged commit 1377f93 into master Jun 14, 2024
11 checks passed
@web3-developer web3-developer deleted the fluffy-state-json-rpc-apis branch June 14, 2024 17:03
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.

None yet

2 participants