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

fix vm fork #3796

Merged
merged 2 commits into from
Jun 14, 2023
Merged

fix vm fork #3796

merged 2 commits into from
Jun 14, 2023

Conversation

yann300
Copy link
Contributor

@yann300 yann300 commented Jun 13, 2023

rewrite of the CustomEthersStateManager.
the previous implementation didn't handle well the checkpoint/revert.

in order to test it:

  • compile
contract Campaign {
    uint public cake;
    function contribute() public payable {
       cake++;
    }
}
  • deploy and call contribute
  • access "cake", this should print "1"
  • call contribute again
  • access "cake", this should print "2"

@netlify
Copy link

netlify bot commented Jun 13, 2023

Deploy Preview for remixproject ready!

Name Link
🔨 Latest commit e4547f3
🔍 Latest deploy log https://app.netlify.com/sites/remixproject/deploys/6489ec910332280007bf7379
😎 Deploy Preview https://deploy-preview-3796--remixproject.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.


class CustomEthersStateManager extends StateManagerCommonStorageDump {
private provider: ethers.providers.StaticJsonRpcProvider | ethers.providers.JsonRpcProvider
private blockTag: string
Copy link
Member

Choose a reason for hiding this comment

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

blockTag type definition (string) does not match it's type definition on line 93 (bigint | 'earliest')

} else if (opts.provider instanceof ethers.providers.JsonRpcProvider) {
this.provider = opts.provider
} else {
throw new Error(`valid JsonRpcProvider or url required; got ${opts.provider}`)
Copy link
Member

Choose a reason for hiding this comment

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

provider can be of 3 types string | ethers.providers.StaticJsonRpcProvider | ethers.providers.JsonRpcProvider. Shouldn't there be a third check for else if (opts.provider instanceof ethers.providers.StaticJsonRpcProvider) before the else statement?

Copy link
Contributor Author

@yann300 yann300 Jun 14, 2023

Choose a reason for hiding this comment

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

StaticJsonRpcProvider is a JsonRpcProvider so it should just respond true to that check.

@yann300 yann300 force-pushed the fix_vm_fork branch 3 times, most recently from 9e53fa6 to d390adf Compare June 14, 2023 16:27
@yann300 yann300 enabled auto-merge June 14, 2023 16:38
@yann300 yann300 merged commit 8da7c95 into master Jun 14, 2023
@yann300 yann300 deleted the fix_vm_fork branch June 14, 2023 16:53
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