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(precompile): add FundCommunityPool precompile tx for distribution module #2572

Merged
merged 24 commits into from
Jun 13, 2024

Conversation

luchenqun
Copy link
Contributor

@luchenqun luchenqun commented May 25, 2024

Description

I don't have evmos native token to deposit into the community pool, but I can facilitate a FundCommunityPool precompiled contract transaction for users who have ideas to contribute funds to the community pool. 😄😄😄

js test script

import { ethers } from 'ethers';

export const main = async () => {
  const rpc = 'http://127.0.0.1:8545';
  const abi = [
    {
      inputs: [
        {
          internalType: 'address',
          name: 'depositor',
          type: 'address',
        },
        {
          internalType: 'uint256',
          name: 'amount',
          type: 'uint256',
        },
      ],
      name: 'fundCommunityPool',
      outputs: [
        {
          internalType: 'bool',
          name: 'success',
          type: 'bool',
        },
      ],
      stateMutability: 'nonpayable',
      type: 'function',
    },
  ];
  const provider = new ethers.JsonRpcProvider(rpc);
  const privateKey = 'YOU_PRIVATE_KEY';
  const wallet = new ethers.Wallet(privateKey, provider);
  const distribution = new ethers.Contract('0x0000000000000000000000000000000000000801', abi, wallet);

  const distributionModuleAddress = '0x93354845030274cD4bf1686Abd60AB28EC52e1a7';
  console.log('before fundCommunityPool distributionModuleAddress has balance', await provider.getBalance(distributionModuleAddress));

  const depositor = wallet.address;
  const amount = '1000000000000000000';
  const tx = await distribution.fundCommunityPool(depositor, amount);
  const receipt = await tx.wait();
  console.log('fundCommunityPool receipt', receipt);

  console.log('after  fundCommunityPool distributionModuleAddress has balance', await provider.getBalance(distributionModuleAddress));
};

main();

@luchenqun luchenqun requested a review from a team as a code owner May 25, 2024 11:56
@luchenqun luchenqun requested review from hanchon and Vvaradinov and removed request for a team May 25, 2024 11:56
Copy link

codecov bot commented May 25, 2024

Codecov Report

Attention: Patch coverage is 78.18182% with 12 lines in your changes missing coverage. Please review.

Project coverage is 59.06%. Comparing base (f097735) to head (9b548b0).
Report is 185 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2572       +/-   ##
===========================================
- Coverage   70.45%   59.06%   -11.40%     
===========================================
  Files         293      342       +49     
  Lines       22559    21754      -805     
===========================================
- Hits        15893    12848     -3045     
- Misses       5800     7823     +2023     
- Partials      866     1083      +217     
Files Coverage Δ
precompiles/distribution/distribution.go 83.78% <100.00%> (+0.45%) ⬆️
precompiles/distribution/events.go 81.05% <88.23%> (+3.27%) ⬆️
precompiles/distribution/types.go 92.00% <73.33%> (-0.79%) ⬇️
precompiles/distribution/tx.go 68.22% <70.00%> (+1.15%) ⬆️

... and 344 files with indirect coverage changes

@luchenqun luchenqun changed the title feat(precompile): add FundCommunityPool precompile tx for distribution module feat(precompile): add FundCommunityPool precompile tx for distribution module May 25, 2024
@luchenqun
Copy link
Contributor Author

I don't know how to fix "Lint / Run golangci-lint (pull_request) "

precompiles/distribution/tx.go Outdated Show resolved Hide resolved
precompiles/distribution/tx.go Outdated Show resolved Hide resolved
@GAtom22
Copy link
Contributor

GAtom22 commented May 29, 2024

Thanks for the contribution @luchenqun!!
To fix the linter issues, make sure to add //nolint:dupl on the line specified

@luchenqun luchenqun requested a review from GAtom22 May 29, 2024 15:35
@GAtom22
Copy link
Contributor

GAtom22 commented May 31, 2024

Can you please add some integration tests?
some test cases that would be great to have are:

  • calling the function directly to the precompile
  • calling the precompile function using a smart contract

@luchenqun
Copy link
Contributor Author

luchenqun commented May 31, 2024

Can you please add some integration tests? some test cases that would be great to have are:

  • calling the function directly to the precompile
  • calling the precompile function using a smart contract

It would be better if you could provide a previously implemented for the second test case.

Copy link
Contributor

@0xstepit 0xstepit left a comment

Choose a reason for hiding this comment

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

Thanks @luchenqun!

precompiles/distribution/events.go Show resolved Hide resolved
precompiles/distribution/types.go Outdated Show resolved Hide resolved
@GAtom22
Copy link
Contributor

GAtom22 commented Jun 12, 2024

@luchenqun can you please address the conficts?

@0xstepit
Copy link
Contributor

Hey @luchenqun tests are now failing because deposit and tesatFundCommunityPool methods have been removed from the DistributionCaller during the merge.

Copy link

coderabbitai bot commented Jun 13, 2024

Warning

Walkthrough skipped

File diffs could not be summarized.


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 Configration 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.

@luchenqun
Copy link
Contributor Author

luchenqun commented Jun 13, 2024

Hey @luchenqun tests are now failing because deposit and tesatFundCommunityPool methods have been removed from the DistributionCaller during the merge.

It's possible that when I merged with the main branch, I used the content from the main branch in these two files. But now I have updated them back, hahaha.

@0xstepit There is still a E2E Test / test-nix (test_filters.py) (pull_request) that has not passed. I don't know what the problem is, I need you to take a look.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Outside diff range and nitpick comments (7)
precompiles/distribution/types.go (1)

48-52: Add documentation for EventFundCommunityPool.

It's a good practice to include comments explaining the purpose and usage of newly introduced types. This helps maintain readability and usability of the codebase.

tests/nix_tests/utils.py (4)

Line range hint 103-104: Convert to f-string for better readability and performance.

- "Waited too long for the port {} on host {} to start accepting connections.".format(port, host)
+ f"Waited too long for the port {port} on host {host} to start accepting connections."

Line range hint 172-172: Rename unused loop variable for clarity.

- for i in range(int(timeout / interval)):
+ for _i in range(int(timeout / interval)):

Line range hint 374-374: Use isinstance() for type checking instead of direct type comparison.

- if type(attr["key"]) is str:
+ if isinstance(attr["key"], str):

Line range hint 488-488: Avoid using mutable default arguments to prevent bugs.

- def build_deploy_contract_tx(w3, info, args=(), key=KEYS["validator"]):
+ def build_deploy_contract_tx(w3, info, args=None, key=KEYS["validator"]):
+     if args is None:
+         args = ()
CHANGELOG.md (2)

Line range hint 932-932: Indentation issue detected in unordered list items.

- - (deps) [#1985](https://github.com/evmos/evmos/pull/1985) Add CI action to check for a Changelog entry on PRs to `main`.
+   - (deps) [#1985](https://github.com/evmos/evmos/pull/1985) Add CI action to check for a Changelog entry on PRs to `main`.
Tools
Markdownlint

55-55: Expected: 120; Actual: 134 (MD013, line-length)
Line length


57-57: Expected: 120; Actual: 128 (MD013, line-length)
Line length


Line range hint 48-48: Line exceeds the recommended character limit.

Consider breaking this line into two to improve readability and adhere to Markdown best practices.

Tools
Markdownlint

55-55: Expected: 120; Actual: 134 (MD013, line-length)
Line length


57-57: Expected: 120; Actual: 128 (MD013, line-length)
Line length

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between dd43f33 and 9b548b0.

Files selected for processing (17)
  • .github/workflows/e2e-test.yml (1 hunks)
  • CHANGELOG.md (1 hunks)
  • precompiles/common/errors.go (1 hunks)
  • precompiles/distribution/DistributionI.sol (6 hunks)
  • precompiles/distribution/abi.json (2 hunks)
  • precompiles/distribution/distribution.go (2 hunks)
  • precompiles/distribution/distribution_test.go (2 hunks)
  • precompiles/distribution/events.go (2 hunks)
  • precompiles/distribution/events_test.go (2 hunks)
  • precompiles/distribution/integration_test.go (5 hunks)
  • precompiles/distribution/tx.go (7 hunks)
  • precompiles/distribution/tx_test.go (1 hunks)
  • precompiles/distribution/types.go (3 hunks)
  • precompiles/testutil/contracts/DistributionCaller.sol (10 hunks)
  • tests/nix_tests/cosmoscli.py (1 hunks)
  • tests/nix_tests/test_distr_precompile.py (1 hunks)
  • tests/nix_tests/utils.py (1 hunks)
Files not summarized due to errors (2)
  • precompiles/distribution/distribution_test.go: Error: Server error. Please try again later.
  • tests/nix_tests/cosmoscli.py: Error: Server error. Please try again later.
Files not reviewed due to errors (7)
  • precompiles/common/errors.go (Error: Server error. Please try again later.)
  • tests/nix_tests/test_distr_precompile.py (Error: Server error. Please try again later.)
  • precompiles/distribution/distribution.go (Error: Server error. Please try again later.)
  • precompiles/distribution/events.go (Error: Server error. Please try again later.)
  • precompiles/distribution/tx.go (Error: Server error. Please try again later.)
  • precompiles/distribution/tx_test.go (Error: Server error. Please try again later.)
  • precompiles/distribution/abi.json (Error: Server error. Please try again later.)
Files skipped from review due to trivial changes (1)
  • .github/workflows/e2e-test.yml
Additional context used
GitHub Check: codecov/patch
precompiles/distribution/events.go

[warning] 175-175: precompiles/distribution/events.go#L175
Added line #L175 was not covered by tests

precompiles/distribution/tx.go

[warning] 243-243: precompiles/distribution/tx.go#L243
Added line #L243 was not covered by tests


[warning] 249-249: precompiles/distribution/tx.go#L249
Added line #L249 was not covered by tests


[warning] 259-259: precompiles/distribution/tx.go#L259
Added line #L259 was not covered by tests

precompiles/distribution/types.go

[warning] 169-169: precompiles/distribution/types.go#L169
Added line #L169 was not covered by tests


[warning] 178-178: precompiles/distribution/types.go#L178
Added line #L178 was not covered by tests

Ruff
tests/nix_tests/utils.py

103-104: Use f-string instead of format call (UP032)

Convert to f-string


172-172: Loop control variable i not used within loop body (B007)

Rename unused i to _i


374-374: Do not compare types, use isinstance() (E721)


488-488: Do not use mutable data structures for argument defaults (B006)

Replace with None; initialize within function

Markdownlint
CHANGELOG.md

932-932: Expected: 4; Actual: 2 (MD007, ul-indent)
Unordered list indentation


933-933: Expected: 4; Actual: 2 (MD007, ul-indent)
Unordered list indentation


934-934: Expected: 4; Actual: 2 (MD007, ul-indent)
Unordered list indentation


48-48: Expected: 120; Actual: 127 (MD013, line-length)
Line length


55-55: Expected: 120; Actual: 134 (MD013, line-length)
Line length


57-57: Expected: 120; Actual: 128 (MD013, line-length)
Line length


71-71: Expected: 120; Actual: 162 (MD013, line-length)
Line length


74-74: Expected: 120; Actual: 167 (MD013, line-length)
Line length


80-80: Expected: 120; Actual: 132 (MD013, line-length)
Line length


83-83: Expected: 120; Actual: 152 (MD013, line-length)
Line length


90-90: Expected: 120; Actual: 137 (MD013, line-length)
Line length


105-105: Expected: 120; Actual: 129 (MD013, line-length)
Line length


120-120: Expected: 120; Actual: 142 (MD013, line-length)
Line length


121-121: Expected: 120; Actual: 133 (MD013, line-length)
Line length


176-176: Expected: 120; Actual: 151 (MD013, line-length)
Line length


180-180: Expected: 120; Actual: 147 (MD013, line-length)
Line length


182-182: Expected: 120; Actual: 149 (MD013, line-length)
Line length


183-183: Expected: 120; Actual: 154 (MD013, line-length)
Line length


187-187: Expected: 120; Actual: 148 (MD013, line-length)
Line length


188-188: Expected: 120; Actual: 128 (MD013, line-length)
Line length


191-191: Expected: 120; Actual: 131 (MD013, line-length)
Line length


202-202: Expected: 120; Actual: 150 (MD013, line-length)
Line length


214-214: Expected: 120; Actual: 189 (MD013, line-length)
Line length


224-224: Expected: 120; Actual: 134 (MD013, line-length)
Line length


230-230: Expected: 120; Actual: 130 (MD013, line-length)
Line length


234-234: Expected: 120; Actual: 138 (MD013, line-length)
Line length


238-238: Expected: 120; Actual: 137 (MD013, line-length)
Line length


244-244: Expected: 120; Actual: 136 (MD013, line-length)
Line length


246-246: Expected: 120; Actual: 137 (MD013, line-length)
Line length


248-248: Expected: 120; Actual: 132 (MD013, line-length)
Line length


249-249: Expected: 120; Actual: 144 (MD013, line-length)
Line length


251-251: Expected: 120; Actual: 164 (MD013, line-length)
Line length


252-252: Expected: 120; Actual: 139 (MD013, line-length)
Line length


255-255: Expected: 120; Actual: 139 (MD013, line-length)
Line length


265-265: Expected: 120; Actual: 129 (MD013, line-length)
Line length


266-266: Expected: 120; Actual: 142 (MD013, line-length)
Line length


272-272: Expected: 120; Actual: 186 (MD013, line-length)
Line length


273-273: Expected: 120; Actual: 153 (MD013, line-length)
Line length


277-277: Expected: 120; Actual: 139 (MD013, line-length)
Line length


279-279: Expected: 120; Actual: 152 (MD013, line-length)
Line length


285-285: Expected: 120; Actual: 149 (MD013, line-length)
Line length


286-286: Expected: 120; Actual: 159 (MD013, line-length)
Line length


288-288: Expected: 120; Actual: 132 (MD013, line-length)
Line length


290-290: Expected: 120; Actual: 172 (MD013, line-length)
Line length


307-307: Expected: 120; Actual: 149 (MD013, line-length)
Line length


309-309: Expected: 120; Actual: 145 (MD013, line-length)
Line length


319-319: Expected: 120; Actual: 231 (MD013, line-length)
Line length


322-322: Expected: 120; Actual: 142 (MD013, line-length)
Line length


328-328: Expected: 120; Actual: 145 (MD013, line-length)
Line length


331-331: Expected: 120; Actual: 155 (MD013, line-length)
Line length


332-332: Expected: 120; Actual: 138 (MD013, line-length)
Line length


333-333: Expected: 120; Actual: 151 (MD013, line-length)
Line length


334-334: Expected: 120; Actual: 132 (MD013, line-length)
Line length


335-335: Expected: 120; Actual: 160 (MD013, line-length)
Line length


357-357: Expected: 120; Actual: 172 (MD013, line-length)
Line length


361-361: Expected: 120; Actual: 142 (MD013, line-length)
Line length


362-362: Expected: 120; Actual: 138 (MD013, line-length)
Line length


377-377: Expected: 120; Actual: 141 (MD013, line-length)
Line length


380-380: Expected: 120; Actual: 127 (MD013, line-length)
Line length


381-381: Expected: 120; Actual: 141 (MD013, line-length)
Line length


393-393: Expected: 120; Actual: 169 (MD013, line-length)
Line length


399-399: Expected: 120; Actual: 147 (MD013, line-length)
Line length


412-412: Expected: 120; Actual: 158 (MD013, line-length)
Line length


414-414: Expected: 120; Actual: 306 (MD013, line-length)
Line length


432-432: Expected: 120; Actual: 147 (MD013, line-length)
Line length


438-438: Expected: 120; Actual: 180 (MD013, line-length)
Line length


449-449: Expected: 120; Actual: 168 (MD013, line-length)
Line length


489-489: Expected: 120; Actual: 138 (MD013, line-length)
Line length


490-490: Expected: 120; Actual: 131 (MD013, line-length)
Line length


500-500: Expected: 120; Actual: 129 (MD013, line-length)
Line length


508-508: Expected: 120; Actual: 262 (MD013, line-length)
Line length


516-516: Expected: 120; Actual: 143 (MD013, line-length)
Line length


521-521: Expected: 120; Actual: 133 (MD013, line-length)
Line length


522-522: Expected: 120; Actual: 143 (MD013, line-length)
Line length


527-527: Expected: 120; Actual: 140 (MD013, line-length)
Line length


537-537: Expected: 120; Actual: 142 (MD013, line-length)
Line length


544-544: Expected: 120; Actual: 262 (MD013, line-length)
Line length


566-566: Expected: 120; Actual: 136 (MD013, line-length)
Line length


579-579: Expected: 120; Actual: 130 (MD013, line-length)
Line length


586-586: Expected: 120; Actual: 135 (MD013, line-length)
Line length


601-601: Expected: 120; Actual: 230 (MD013, line-length)
Line length


602-602: Expected: 120; Actual: 131 (MD013, line-length)
Line length


603-603: Expected: 120; Actual: 177 (MD013, line-length)
Line length


604-604: Expected: 120; Actual: 203 (MD013, line-length)
Line length


605-605: Expected: 120; Actual: 156 (MD013, line-length)
Line length


609-609: Expected: 120; Actual: 148 (MD013, line-length)
Line length


617-617: Expected: 120; Actual: 163 (MD013, line-length)
Line length


672-672: Expected: 120; Actual: 160 (MD013, line-length)
Line length


696-696: Expected: 120; Actual: 226 (MD013, line-length)
Line length


701-701: Expected: 120; Actual: 145 (MD013, line-length)
Line length


757-757: Expected: 120; Actual: 140 (MD013, line-length)
Line length


765-765: Expected: 120; Actual: 166 (MD013, line-length)
Line length


769-769: Expected: 120; Actual: 147 (MD013, line-length)
Line length


793-793: Expected: 120; Actual: 169 (MD013, line-length)
Line length


798-798: Expected: 120; Actual: 141 (MD013, line-length)
Line length


799-799: Expected: 120; Actual: 167 (MD013, line-length)
Line length


835-835: Expected: 120; Actual: 144 (MD013, line-length)
Line length


845-845: Expected: 120; Actual: 146 (MD013, line-length)
Line length


846-846: Expected: 120; Actual: 233 (MD013, line-length)
Line length


848-848: Expected: 120; Actual: 159 (MD013, line-length)
Line length


856-856: Expected: 120; Actual: 160 (MD013, line-length)
Line length


857-857: Expected: 120; Actual: 133 (MD013, line-length)
Line length


909-909: Expected: 120; Actual: 131 (MD013, line-length)
Line length


926-926: Expected: 120; Actual: 131 (MD013, line-length)
Line length


932-932: Expected: 120; Actual: 163 (MD013, line-length)
Line length


954-954: Expected: 120; Actual: 184 (MD013, line-length)
Line length


967-967: Expected: 120; Actual: 168 (MD013, line-length)
Line length


987-987: Expected: 120; Actual: 154 (MD013, line-length)
Line length

Additional comments not posted (8)
precompiles/testutil/contracts/DistributionCaller.sol (2)

72-87: The function testFundCommunityPool successfully implements the new feature.

This function correctly increments and decrements the counter around the call to fundCommunityPool, which is a good use of state management to track function calls.


15-17: Ensure consistent use of address types.

Also applies to: 25-27, 36-38, 47-49, 57-58, 66-70, 78-87, 95-96, 104-105, 120-133, 142-144, 150-155, 172-173, 191-193, 203-208, 219-224, 234-238

Verification successful

The script output indicates that address type parameters are used consistently across the Solidity files. There are no apparent inconsistencies in the usage of address parameters within the provided lines and the overall file.

  • File: precompiles/testutil/contracts/DistributionCaller.sol
  • Lines: 15-17, 25-27, 36-38, 47-49, 57-58, 66-70, 78-87, 95-96, 104-105, 120-133, 142-144, 150-155, 172-173, 191-193, 203-208, 219-224, 234-238

The usage of address parameters appears consistent across the specified lines.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify all address parameters across functions are consistently used.

# Test: Search for the usage of address type parameters. Expect: Consistent usage.
rg --type solidity $'address'

Length of output: 61



Script:

#!/bin/bash
# Description: Find all Solidity files and search for address type parameters.

# Step 1: Find all Solidity files.
sol_files=$(fd . --extension sol)

# Step 2: Search for address type parameters within these files.
for file in $sol_files; do
    echo "File: $file"
    rg 'address' "$file"
done

Length of output: 38077

precompiles/distribution/distribution_test.go (2)

39-43: The test case for FundCommunityPoolMethod is correctly added.

The addition of this test case ensures that the new functionality is covered by the suite, which is crucial for maintaining the robustness of the feature.


158-172: Integration test for FundCommunityPoolMethod is implemented correctly.

The test setup and execution for the new FundCommunityPoolMethod are well-implemented, ensuring the functionality works as expected under simulated conditions.

precompiles/distribution/DistributionI.sol (1)

71-76: The FundCommunityPool event and method are correctly defined.

The addition of these definitions is crucial for the new functionality, allowing interaction with the community pool through a precompiled contract.

Also applies to: 114-123

precompiles/distribution/events_test.go (1)

254-289: The test for the FundCommunityPool event is implemented correctly.

This test ensures that the event is emitted correctly when the FundCommunityPool function is called, which is essential for verifying the integration of the new feature.

precompiles/distribution/types.go (1)

159-169: Verify the use of custom error messages and their documentation.

Also applies to: 178-178

Verification successful

The custom error messages ErrInvalidNumberOfArgs, ErrInvalidHexAddress, and ErrInvalidAmount are well-documented in precompiles/common/errors.go and are used consistently across the codebase.

  • Definitions and documentation:

    • precompiles/common/errors.go
  • Consistent usage:

    • precompiles/staking/types.go
    • precompiles/ics20/types.go
    • precompiles/vesting/types.go
    • precompiles/distribution/types.go
    • precompiles/bank/types.go
    • precompiles/authorization/types.go
    • precompiles/bech32/methods.go
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the consistency and documentation of custom error messages used in `NewMsgFundCommunityPool`.

# Test: Search for the error message definitions in the codebase. Expect: Clear documentation and consistent usage.
rg --type go $'ErrInvalidNumberOfArgs|ErrInvalidHexAddress|ErrInvalidAmount' --glob '*.go'

Length of output: 10644

Tools
GitHub Check: codecov/patch

[warning] 169-169: precompiles/distribution/types.go#L169
Added line #L169 was not covered by tests

tests/nix_tests/cosmoscli.py (1)

398-403: Good error handling by checking for the presence of keys and non-empty arrays.

precompiles/distribution/types.go Show resolved Hide resolved
precompiles/distribution/integration_test.go Show resolved Hide resolved
precompiles/distribution/integration_test.go Show resolved Hide resolved
precompiles/distribution/integration_test.go Show resolved Hide resolved
precompiles/distribution/integration_test.go Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@GAtom22 GAtom22 merged commit 2628978 into evmos:main Jun 13, 2024
43 of 49 checks passed
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

3 participants