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

feat: add e2e test stateful contract #2703

Merged
merged 33 commits into from
Aug 21, 2024

Conversation

fbac
Copy link
Contributor

@fbac fbac commented Aug 14, 2024

Description

Include the first test stateful contract.

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Copy link
Contributor

coderabbitai bot commented Aug 14, 2024

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Base branches to auto review (1)
  • develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@fbac fbac changed the title Feat/add stateful contract feat: add test stateful contract Aug 14, 2024
@fbac fbac force-pushed the feat/add-stateful-contract branch 3 times, most recently from 7c7d22c to ca1d772 Compare August 14, 2024 18:55
@fbac fbac force-pushed the feat/add-stateful-contract branch from ca1d772 to b9878a6 Compare August 14, 2024 18:55
@fbac fbac force-pushed the feat/add-stateful-contract branch from 8685c21 to 40ff210 Compare August 14, 2024 19:13
@fbac fbac force-pushed the feat/add-stateful-contract branch from 75ccd15 to 83457fc Compare August 14, 2024 19:23
@fbac fbac force-pushed the feat/add-stateful-contract branch from c3ef341 to e4d43d4 Compare August 15, 2024 12:11
@fbac fbac marked this pull request as ready for review August 15, 2024 12:12
@fbac fbac changed the title feat: add test stateful contract feat: add e2e test stateful contract Aug 15, 2024
@fbac fbac force-pushed the feat/add-stateful-contract branch 3 times, most recently from 8b95bfb to 58b865a Compare August 15, 2024 12:41
@fbac fbac force-pushed the feat/add-stateful-contract branch from 58b865a to eaac523 Compare August 15, 2024 12:56
Copy link
Contributor

@skosito skosito left a comment

Choose a reason for hiding this comment

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

looks good, just minor comments

@fbac fbac force-pushed the feat/add-stateful-contract branch from e59d239 to 3fa0cab Compare August 20, 2024 12:15
@zeta-chain zeta-chain deleted a comment from codecov bot Aug 20, 2024
@zeta-chain zeta-chain deleted a comment from codecov bot Aug 20, 2024
@zeta-chain zeta-chain deleted a comment from codecov bot Aug 20, 2024
@fbac fbac force-pushed the feat/add-stateful-contract branch from efd7f51 to b62a99e Compare August 20, 2024 15:56
@zeta-chain zeta-chain deleted a comment from codecov bot Aug 20, 2024
@fbac fbac requested review from lumtis and skosito August 20, 2024 16:10
@zeta-chain zeta-chain deleted a comment from codecov bot Aug 20, 2024
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 73.97260% with 38 lines in your changes missing coverage. Please review.

Project coverage is 70.38%. Comparing base (a6fa3e7) to head (9cbc274).
Report is 1 commits behind head on feat/stateful-precompiled-contracts.

Files Patch % Lines
precompiles/prototype/prototype.go 69.35% 33 Missing and 5 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                           Coverage Diff                           @@
##           feat/stateful-precompiled-contracts    #2703      +/-   ##
=======================================================================
+ Coverage                                70.35%   70.38%   +0.02%     
=======================================================================
  Files                                      338      342       +4     
  Lines                                    18599    18745     +146     
=======================================================================
+ Hits                                     13085    13193     +108     
- Misses                                    4922     4955      +33     
- Partials                                   592      597       +5     
Files Coverage Δ
precompiles/precompiles.go 100.00% <100.00%> (ø)
precompiles/types/errors.go 100.00% <100.00%> (ø)
precompiles/types/types.go 100.00% <100.00%> (ø)
precompiles/prototype/prototype.go 69.35% <69.35%> (ø)

@fbac fbac force-pushed the feat/add-stateful-contract branch from 974fef1 to ac48e29 Compare August 20, 2024 20:36
@fbac fbac merged commit 871cdd1 into feat/stateful-precompiled-contracts Aug 21, 2024
24 checks passed
@fbac fbac deleted the feat/add-stateful-contract branch August 21, 2024 10:48
github-merge-queue bot pushed a commit that referenced this pull request Aug 27, 2024
* chore: cleanup Makefile and go.mod

* feat: introduce stateful precompiles initial support

* chore: remove simapp as a dependency

* fix: adapt to testutil to changes

* fix: linting

* chore: add changelog and remove unused vars

* fix: create aggregateAllKeys function

* feat: add e2e test stateful contract (#2703)

* feat: add test precompiled contract

* feat: add test stateful contract

* feat: enable contracts granularly

* feat: allow passing the app ctx to contracts

* revert ctx changes

* format ABI

* add first e2e test

* add RegularCaller contract to e2e

* add signer to deployment

* fix e2e, use regular abi

* minor rewording

* use idiomatic errors

* remove unused files

* rename and generate bindings automatically

* create a new e2e section for precompiles

* add bindings generator and makefile target

* add GetGasStabilityPoolBalance as prototype contract function

* include getGasStabilityPoolBalance function

* apply code review fixes

* include tests for precompiles package

* delete regularcaller

* ignore bindings from codecov

* introduce more unit testing

* add unit testing for prototype.go

* minor linting fixes

* remove ctx, keep fungible keeper private

* increase unit tests coverage

* add keys for new user_precompile

* add init unit test

* switch to double quotes

* avoid go:embed

* fixes derived from code review

* refactor some parts of bech32 functions

* formatting

* new generated mocks

* skip precompile tests during upgrade

* skip precompile

* try to fix generate

* debug script

* install solc in generate files

* install abigen

* cleanup action

* PR comments pt1

* group prototype unit tests a bit

* PR comment missing test

* cleanup action a bit

* add solc checks to script

* cleanup not needed changes

* revert ibc change in test

* remove new test

* reduce simple operations gas required to 500

---------

Co-authored-by: skosito <[email protected]>
Co-authored-by: Dmitry S <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants