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

Handle 'web.accounts' call in Jail properly #385

Closed
wants to merge 1 commit into from

Conversation

divan
Copy link
Contributor

@divan divan commented Oct 5, 2017

This PR fixes a bug (#384) with incorrect routing of web3.eth.account() call in Jail. Bug was introduced in #351 when eth_account handler was implemented and properly handled in RPC client, but it's jail's counterpart was forgotten.

Copy link
Contributor

@adambabik adambabik left a comment

Choose a reason for hiding this comment

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

This PR does not include a test which correctly reproduces the bug and fixes it.

@@ -51,6 +52,11 @@ func registerHandlers(jail *Jail, cell common.JailCell, chatID string) error {
return err
}

// register accounts handler
if err = registerHandler("accounts", makeAccountsHandler(jail, cell)); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't get it. In StatusBackend we have:

rpcClient.RegisterHandler("eth_accounts", m.accountManager.AccountsRPCHandler())
rpcClient.RegisterHandler("eth_sendTransaction", m.txQueueManager.SendTransactionRPCHandler)

When web3.eth.accounts is called, it should do an RPC call and go through the already registered handler.

@divan
Copy link
Contributor Author

divan commented Oct 16, 2017

This solution seems to be incorrect and doesn't fix bug it mentions. It's not a routing issue, rather result conversion issue when converting data from otto VM. Closing this for now.

@divan divan closed this Oct 16, 2017
@adambabik adambabik deleted the bugfix/jail_accounts-#384 branch December 27, 2019 10:02
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