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

Historical data availability needed for hardhat-chai-matchers #475

Open
cytadela8 opened this issue Dec 5, 2024 · 0 comments
Open

Historical data availability needed for hardhat-chai-matchers #475

cytadela8 opened this issue Dec 5, 2024 · 0 comments

Comments

@cytadela8
Copy link
Member

🌟 Feature Request

📝 Description

Hardhat chai matchers need access to historical balances and state. If possible we should implement eth_getBalance and eth_call for historical (non-latest) blocks.

🤔 Rationale

People use changeEtherBalance and chnageTokenBalance hardhat-chai-matchers. We claim right now that hardhat-chai-matchers just work, but this is not the case

📋 Additional Context

This is the essence of implementation of .changedEtherBalance in hardhat-chai-matchers:

  const balanceAfterHex = await provider.send("eth_getBalance", [
    address,
    `0x${txBlockNumber.toString(16)}`,
  ]);

  const balanceBeforeHex = await provider.send("eth_getBalance", [
    address,
    `0x${(txBlockNumber - 1).toString(16)}`,
  ]);
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

No branches or pull requests

1 participant