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

internal/web3ext: Add eth.getProof #18052

Merged
merged 1 commit into from
Nov 8, 2018

Conversation

ryanschneider
Copy link
Contributor

I wanted to give eth_getProof a test drive but found that it wasn't available in the console provided by geth attach so added it to web3ext. It's not 100% clear to me when I should add methods to web3ext vs. internal/jsre/deps/web3.js (followed by a go generate), so I'm happy to change this PR to do the changes in web3.js instead if preferred.

Both ways give me the same result (I elided the proof values below with "..." to keep this PR text from being too long, in the actual output the correct hex strings are output.

> eth.getProof("0x09d8b66c48424324b25754a873e290cae5dca439", ["0x0"], "latest")
{
  accountProof: ["...", "...", "...", "...", "...", "...", "...", "..."],
  address: "0x09d8b66c48424324b25754a873e290cae5dca439",
  balance: "0x0",
  codeHash: "0x49a2e4941f66f56811a3ba9153696e692b305bc57c3b4e0a727b8c0c422f275f",
  nonce: "0x1",
  storageHash: "0x8c07d8edd90c3adf163ddcd046e482b1b061fac7fb31e10306aedc8f1d84f26f",
  storageProof: [{
      key: "0x0",
      proof: ["...", "...", "...", "..."],
      value: "0xdff10fcaccc3b18a1604509e9b4d0b9a7091278"
  }]
}

@ryanschneider
Copy link
Contributor Author

Pinging @holiman and @ligi since you both approved the related PR #17737 and no reviewer for this area is specified in CODEOWNERS.

@holiman
Copy link
Contributor

holiman commented Nov 7, 2018

It's not 100% clear to me when I should add methods to web3ext vs. internal/jsre/deps/web3.js

... me neither 🤷‍♂️ ...

@fjl
Copy link
Contributor

fjl commented Nov 8, 2018

We don't want to modify web3.js directly, adding it to the extension file is fine.

@fjl fjl merged commit bd519ab into ethereum:master Nov 8, 2018
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.

3 participants