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

test: improve suite #242

Merged
merged 8 commits into from
Feb 6, 2025
Merged

Conversation

mbreithecker
Copy link
Member

@mbreithecker mbreithecker commented Feb 4, 2025

Summary by CodeRabbit

  • New Features
    • Introduced improved validator management with clearer error messaging for inactive validators during pool operations.
  • Bug Fixes
    • Revised token decimal precision, reduced minimum funding amounts, and updated reward calculations for accurate economics.
    • Adjusted baseline gas consumption for more precise transaction fee estimates.
  • Refactor
    • Streamlined the initialization and testing framework for a cleaner, more reliable chain setup and enhanced pool and staking mechanics.
    • Enhanced the test suite for stakers module to validate critical functionalities related to validator management and pool interactions.

Copy link

coderabbitai bot commented Feb 4, 2025

Walkthrough

The changes refactor the way application instances are initialized for testing by replacing legacy calls (e.g., using app.Setup()) with a cleaner approach via i.NewCleanChain().App(). Several integration utility files have been updated to streamline minting, validator creation, and funding parameter settings. Additionally, some testing helper methods and files have been removed, while various test cases across bundles, stakers, pool, funders, and team modules have been adjusted to reflect new calculation logic, error handling, and parameter values. No public API changes have been made.

Changes

File(s) Change Summary
interchaintest/global/abci_utils_test.go, interchaintest/ibc/ibc_utils_test.go Updated import statements and initialization in encodingConfig; replaced app.Setup() with i.NewCleanChain().App().
testutil/integration/integration.go, testutil/integration/setup.go Refactored chain setup: integration.go now uses NewCleanChainAtTime/SetupApp with new minting and validator creation methods; package renamed to integration.
testutil/integration/transactions.go Removed methods: RunTxDelegatorSuccess, RunTxDelegatorError, and RunTxPoolError to simplify transaction testing.
testutil/nullify/nullify.go, testutil/sample/sample.go Deleted utility files for initializing nil struct fields and generating sample account addresses.
x/bundles/keeper/keeper_suite_inflation_splitting_test.go Updated expected commission rewards and self-delegation values to align with revised inflation payout calculations.
x/bundles/keeper/keeper_suite_valid_bundles_test.go Adjusted coin decimals and funding amounts within valid bundle proposals to reflect new value parameters.
x/bundles/keeper/keeper_suite_zero_delegation_test.go Replaced hardcoded validator creation with CreateNewValidator and updated references with actual validator addresses for zero delegation tests.
x/bundles/keeper/logic_round_robin_test.go Modified the shift calculation from a larger to a smaller value, affecting validator progress assertions.
x/funders/types/params.go, x/pool/keeper/msg_server_disable_pool_test.go, x/pool/keeper/msg_server_update_pool_test.go Updated minimum funding amounts and JSON payload values used in pool operations and funding parameters.
x/global/ante_test.go Adjusted the BaseCost value in GasAdjustmentDecorator tests for updated gas consumption expectations.
x/stakers/keeper/keeper.go, x/stakers/keeper/keeper_suite_effective_stake_test.go, x/stakers/keeper/keeper_suite_protocol_bridge_test.go, x/stakers/keeper/msg_server_join_pool.go, x/stakers/types/errors.go Modified staker module: updated account retrieval to use util.MustAccountAddressFromValAddress, revised effective stake tests to employ the new validator creation, added a protocol bridge test suite, and streamlined error handling by replacing ErrValidatorJailed with ErrValidatorNotInActiveSet.
x/team/keeper/msg_server_clawback_test.go, x/team/types/types.go Revised vesting account expected values (e.g., TotalVestedAmount, LockedVestedAmount) and maintained TEAM_ALLOCATION_STRING consistency.

Sequence Diagram(s)

sequenceDiagram
    participant TestRunner
    participant IntegrationSuite
    participant CleanChainFactory as NewCleanChain()
    participant AppInstance
    TestRunner->>IntegrationSuite: Call SetupApp(startTime)
    IntegrationSuite->>CleanChainFactory: Invoke NewCleanChain()
    CleanChainFactory->>AppInstance: Initialize and return App instance
    IntegrationSuite->>TestRunner: Return AppInstance
Loading
sequenceDiagram
    participant Validator
    participant MsgServer
    participant StakerKeeper
    Validator->>MsgServer: Send JoinPool request
    MsgServer->>StakerKeeper: Request validator details
    StakerKeeper->>MsgServer: Return address (via MustAccountAddressFromValAddress)
    MsgServer->>Validator: Return error (ErrValidatorNotInActiveSet) if not active
Loading

Possibly related PRs

  • chore: pool account renaming #214: The changes in the main PR and the retrieved PR are related as both involve modifications to how application instances are initialized for testing, specifically focusing on the transition from using validator addresses to pool addresses in their respective contexts.
  • test: multiple coins final tests #186: The changes in the main PR and the retrieved PR are related as both involve modifications to the initialization of application instances and the handling of coins within the testing framework, specifically in the context of the encodingConfig function and the introduction of multiple coin support.
  • feat: Shared Staking #209: The changes in the main PR regarding the initialization of application instances in the encodingConfig function are related to the modifications in the retrieved PR, which also involve similar changes to how application instances are set up for testing in the encodingConfig function. Both PRs reflect a shift towards using NewCleanChain() for cleaner testing setups.

Suggested reviewers

  • troykessler

Poem

I’m a rabbit, hopping through code so spry,
New chains created, as I watch tests fly,
Validators and coins now dance in a neat line,
With cleaner setups, everything aligns,
In fields of logic, I cheer with delight—
Happy hops to changes shining bright! 🐇

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d1f5ca and 1ed69d5.

📒 Files selected for processing (1)
  • x/stakers/keeper/keeper_suite_protocol_bridge_test.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • x/stakers/keeper/keeper_suite_protocol_bridge_test.go

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

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: 1

🧹 Nitpick comments (7)
testutil/integration/integration.go (1)

114-163: Potentially unhandled mint errors.

Calls to MintBaseCoins in initDummyAccounts ignore errors using _ = .... This is typical in tests, but it may hide unexpected failures.

-   _ = suite.MintBaseCoins(ALICE, 1000*KYVE)
+   if err := suite.MintBaseCoins(ALICE, 1000*KYVE); err != nil {
+       panic(err)
+   }
x/stakers/keeper/keeper_suite_protocol_bridge_test.go (2)

57-91: Consider adding more assertions for validator state.

While the test verifies pool membership and bonded validators, consider adding assertions for:

  • Validator's jailed status
  • Validator's voting power after slash
  • Detailed slash event verification

184-218: Consider testing edge cases for unbonded validator.

The test could be enhanced by adding cases for:

  • Validator with zero delegation
  • Validator in unbonding period
  • Multiple attempts to join pool
x/bundles/keeper/keeper_suite_inflation_splitting_test.go (4)

17-45: Well-structured test coverage with comprehensive scenarios!

The test suite provides excellent coverage of inflation splitting scenarios. The test cases are logically organized and cover important edge cases.

Consider adding a table in the comments summarizing the test matrix (inflation rates × funder scenarios) to make it easier for other developers to understand the test coverage at a glance.


323-324: Document reward calculation formulas more clearly.

The reward calculations involve complex formulas with multiple factors. While the inline comments show the calculations, they could be more readable.

Consider adding a dedicated section in the comments explaining the reward calculation formulas with:

  • Base formula
  • Variables and their meanings
  • Rounding rules
  • Example calculations

Also applies to: 328-329


1847-1853: Improve assertion documentation for complex calculations.

The test includes detailed assertions for inflation calculations, but some expected values could use better documentation.

Consider:

  • Adding intermediate calculation steps in comments
  • Explaining why specific values are expected
  • Documenting any known rounding behaviors

436-448: Reduce code duplication in test setup.

There's significant duplication in the funder setup code across multiple test cases.

Consider extracting common setup patterns into helper functions:

func (s *KeeperTestSuite) setupFunders(poolId uint64, amounts sdk.Coins, amountsPerBundle sdk.Coins) {
    s.RunTxFundersSuccess(&funderstypes.MsgFundPool{
        Creator:          i.ALICE,
        PoolId:           poolId,
        Amounts:          amounts,
        AmountsPerBundle: amountsPerBundle,
    })
    s.RunTxFundersSuccess(&funderstypes.MsgFundPool{
        Creator:          i.BOB,
        PoolId:           poolId,
        Amounts:          amounts,
        AmountsPerBundle: amountsPerBundle,
    })
}

Also applies to: 540-552, 638-650, 735-747, 838-850, 936-948, 1034-1046, 1137-1149, 1235-1247, 1333-1345, 1436-1448, 1546-1558

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f712d86 and 5d1f5ca.

📒 Files selected for processing (22)
  • interchaintest/global/abci_utils_test.go (1 hunks)
  • interchaintest/ibc/ibc_utils_test.go (2 hunks)
  • testutil/integration/integration.go (10 hunks)
  • testutil/integration/setup.go (4 hunks)
  • testutil/integration/transactions.go (0 hunks)
  • testutil/nullify/nullify.go (0 hunks)
  • testutil/sample/sample.go (0 hunks)
  • x/bundles/keeper/keeper_suite_inflation_splitting_test.go (15 hunks)
  • x/bundles/keeper/keeper_suite_valid_bundles_test.go (5 hunks)
  • x/bundles/keeper/keeper_suite_zero_delegation_test.go (14 hunks)
  • x/bundles/keeper/logic_round_robin_test.go (1 hunks)
  • x/funders/types/params.go (1 hunks)
  • x/global/ante_test.go (1 hunks)
  • x/pool/keeper/msg_server_disable_pool_test.go (1 hunks)
  • x/pool/keeper/msg_server_update_pool_test.go (3 hunks)
  • x/stakers/keeper/keeper.go (1 hunks)
  • x/stakers/keeper/keeper_suite_effective_stake_test.go (2 hunks)
  • x/stakers/keeper/keeper_suite_protocol_bridge_test.go (1 hunks)
  • x/stakers/keeper/msg_server_join_pool.go (1 hunks)
  • x/stakers/types/errors.go (1 hunks)
  • x/team/keeper/msg_server_clawback_test.go (10 hunks)
  • x/team/types/types.go (1 hunks)
💤 Files with no reviewable changes (3)
  • testutil/integration/transactions.go
  • testutil/sample/sample.go
  • testutil/nullify/nullify.go
✅ Files skipped from review due to trivial changes (2)
  • x/global/ante_test.go
  • x/team/types/types.go
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Summary
🔇 Additional comments (35)
testutil/integration/setup.go (6)

1-1: Confirm package rename references.

The package name has changed to integration. Ensure that all references to the old package name (app) have been updated accordingly across the codebase to avoid import-related issues.


7-31: Imports look consistent.

No obvious issues with these newly introduced or modified imports. The dependencies appear necessary and properly referenced.


34-43: Struct extension acknowledged.

The KeeperTestSuite struct introduces multiple fields (ctx, app, denom, privateValidatorKey, etc.). This design is straightforward and promotes clarity in integration tests.


63-127: Initialize chain config carefully.

The SetupApp method properly sets up the app with a local in-memory database, configures Bech32 prefixes, and initializes the chain. Consider verifying that:

  • The chain ID (“kyve-test”) doesn’t conflict with other concurrent tests.
  • Sealing the config doesn’t affect parallel test runs (if any).
    Otherwise, the approach is solid.

129-222: Genesis state customization acknowledged.

DefaultGenesisWithValSet merges default genesis with a validator set and delegator. The method is comprehensive and aligns with typical test environment setups.


224-226: No-op app options confirmed.

EmptyAppOptions is a valid stub for testing environments.

testutil/integration/integration.go (12)

5-8: Verify additions of strconv and Tendermint types imports.

These imports look fine. Confirm they’re strictly necessary if minimal dependencies are desired.


60-60: Validate the updated KYVE constant.

KYVE is changed to 1_000_000 from the previous larger value. Ensure this change doesn’t break existing tests or logic relying on the older magnitude.


104-105: Refactored chain creation function.

Using NewCleanChainAtTime inside NewCleanChain is a clean approach to unify chain creation logic.


109-111: SetupApp usage.

Switching to SetupApp is consistent with the new approach in the setup.go file, ensuring uniform test context initialization.


166-174: Mint multiple denominations.

MintBaseCoins method helpfully streamlines creating multiple denominations in one call. This is well-structured and improves maintainability.


227-238: Enhanced validator address struct.

TestValidatorAddress encapsulates validator data cohesively (e.g., moniker, private key, addresses). This is beneficial for test readability.


240-258: Comprehensive validator creation.

CreateValidatorFromFullAddress sets up a validator with staking parameters in one step. Panic on error is standard for tests but be sure the moniker or stake logic follows test conventions.


312-329: Streamlined new validator creation.

CreateNewValidator and the subsequent minting logic is straightforward. The approach is consistent with the rest of the test suite.


351-361: Zero delegation override.

SetDelegationToZero forcibly modifies the validator’s self-delegation to zero for testing scenarios. This is valid for specialized test cases but ensure that no production code references this logic.


378-381: Voting info usage.

DecidedLastCommit.Votes = suite.VoteInfos helps replicate real block finalization scenarios. Confirm these hypothetical votes match test scenarios for coverage.


407-427: Generator function is well defined.

GenerateTestValidatorAddress neatly packs moniker-based key generation and address creation logic. It’s a neat approach for test data.


429-452: Vote management.

ResetAbciVotes, AddAbciCommitVotes, AddAbciAbsentVote, and addAbciVotes provide flexible vote simulation. Good addition for simulating consensus behavior in tests.

x/stakers/types/errors.go (1)

24-24: Renamed error for clarity.

ErrValidatorNotInActiveSet is more descriptive than the previous ErrValidatorJailed. Confirm all references reflect this updated naming.

x/funders/types/params.go (1)

34-35: Verify the implications of reducing MinFundingAmount.

The minimum funding amount has been significantly reduced from 1,000 $KYVE to 100 $KYVE. While this lowers the barrier to entry for funders, it's important to ensure this aligns with the project's economic model and security considerations.

✅ Verification successful

Economic parameters verified: The reduced MinFundingAmount change aligns with the rest of the codebase.

  • The new minimum funding value (set to 100_000_000, representing 100 $KYVE) is now consistently used in the funders’ parameters (see x/funders/types/params.go) and referenced in related modules (such as in pool disable/update tests).
  • Test cases across modules—where amounts are set as 100 × i.KYVE—confirm that the new value (interpreting i.KYVE as 1,000,000) matches the intended reduction from 1,000 $KYVE to 100 $KYVE.
  • No inconsistencies were found with related economic validations (e.g., funding, delegation, or coin weight checks), implying that lowering the funding amount to reduce the entry barrier is compatible with the project’s economic model and security constraints.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if this change is consistent with other economic parameters

# Search for other minimum amounts in the codebase
rg -A 2 "MinFundingAmount|MinDelegation|MinStake" --type go

# Search for any related test cases
rg -A 5 "TestMinFunding|TestMinDelegation|TestMinStake" --type go

Length of output: 56423

interchaintest/ibc/ibc_utils_test.go (1)

7-8: LGTM! Good improvement in test isolation.

Replacing app.Setup() with i.NewCleanChain().App() ensures a clean state for each test, which is a good practice for test reliability and isolation.

Also applies to: 28-28

x/stakers/keeper/msg_server_join_pool.go (1)

42-42: LGTM! Improved error handling.

The change simplifies error handling by directly returning ErrValidatorNotInActiveSet instead of wrapping it. This makes the error more specific and easier to handle.

interchaintest/global/abci_utils_test.go (1)

30-30: LGTM! Clean initialization approach.

The change to use i.NewCleanChain().App() improves test isolation and follows modern testing practices.

x/stakers/keeper/keeper_suite_protocol_bridge_test.go (1)

16-26: LGTM! Well-structured test cases with clear documentation.

The test cases cover critical scenarios and are well-documented with clear objectives.

x/pool/keeper/msg_server_update_pool_test.go (1)

82-82: LGTM! Consistent parameter updates.

The MinDelegation value has been updated to align with other funding parameters in the codebase, maintaining consistency across the testing framework.

x/bundles/keeper/logic_round_robin_test.go (1)

467-467: LGTM! Consistent shift value adjustment.

The shift calculation has been updated to align with other parameter adjustments in the codebase, maintaining consistency in the testing framework.

x/pool/keeper/msg_server_disable_pool_test.go (1)

72-74: LGTM! Consistent funding parameter update.

The update to set MinFundingAmount to 100,000,000 aligns with similar changes in other test files, ensuring consistent funding parameters across the test suite.

x/stakers/keeper/keeper_suite_effective_stake_test.go (2)

272-305: LGTM! Improved validator creation pattern.

The refactor to use CreateNewValidator improves code maintainability by:

  • Returning structured data with validator details
  • Making the relationship between validator and pool accounts explicit
  • Reducing reliance on hardcoded identifiers

498-502: Verify the updated stake calculations.

The expected stake values have been reduced significantly. Please ensure these new values align with the updated calculation logic.

✅ Verification successful

Stake Calculation Verification: The updated test values are consistent and correct.

The grep results reveal that the new expected values—23333333 for both STAKER_0 and STAKER_1 and 20 × i.KYVE for STAKER_2, summing to a total of 66666666—are used in the effective stake test and match the revised calculation logic. All related tests throughout the codebase reflect similar calculations, confirming that the significant reduction in stake values aligns with the changes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other stake calculations to verify consistency
rg -A 2 "GetValidatorPoolStake|GetTotalStakeOfPool" --type go

Length of output: 52414

x/team/keeper/msg_server_clawback_test.go (1)

51-55: Verify the precision reduction in vesting calculations.

The expected values for vesting amounts have been consistently reduced by three orders of magnitude. Please confirm this aligns with any changes to the vesting calculation logic or precision requirements.

Also applies to: 84-88, 118-122, 167-171, 271-275

✅ Verification successful

Precision reduction confirmed in vesting tests

The repository’s tests and vesting logic confirm that vesting amounts are now computed using a reduced precision – values are scaled down by roughly three orders of magnitude. For example, in msg_server_clawback_test.go, the vesting amounts are compared against literal values (e.g. 694_444_444_444) rather than multiplications against the full precision constant (such as 1_000_000 * i.KYVE). This is consistent with the new vesting calculation logic that factors in a precision reduction.

  • Vesting amounts in tests (e.g. in msg_server_clawback_test.go) use scaled-down literal values.
  • Other parts of the code (e.g. in logic_team.go and related test files) similarly reflect calculations that have shifted to the new precision.

This verifies that the change is intentional and that the reduced precision (by three orders of magnitude) aligns with the updated calculation logic.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other vesting amount calculations
rg -A 2 "TotalVestedAmount|TotalUnlockedAmount|RemainingUnvestedAmount|LockedVestedAmount|CurrentClaimableAmount" --type go

Length of output: 46981

x/bundles/keeper/keeper_suite_zero_delegation_test.go (2)

301-304: LGTM! Improved validator setup.

The use of CreateNewValidator and explicit validator state verification improves test clarity and reliability.


337-339: LGTM! Consistent use of structured validator data.

The update to use validator addresses from the structured data improves code maintainability by reducing reliance on hardcoded identifiers.

Also applies to: 427-429

x/bundles/keeper/keeper_suite_inflation_splitting_test.go (1)

61-161: Robust test setup with proper cleanup!

The test setup and cleanup implementation ensures proper test isolation:

  • Clean chain initialization for each test
  • Proper cleanup of global variables
  • Validity checks after each test
x/bundles/keeper/keeper_suite_valid_bundles_test.go (2)

1052-1053: Address the TODO comment about uploader selection.

The TODO comment questions why staker 2 is selected as the next uploader. This needs to be investigated and documented to ensure the uploader selection logic is working as intended.

Would you like me to:

  1. Help investigate why staker 2 is selected as the next uploader?
  2. Generate additional test cases to verify the uploader selection logic?
  3. Open a new issue to track this investigation?

1799-1802: Verify the consistency of coin parameter updates.

The changes to coin parameters appear to be part of a coordinated update to align with new decimal places and funding requirements. Please verify that these changes are consistent with:

  1. The overall system's decimal place standardization
  2. The intended funding thresholds for the platform

Run the following script to check for any inconsistencies in coin decimal places and funding amounts across the codebase:

✅ Verification successful

Consistency of Coin Parameter Updates Verified

The coin parameter changes in the valid bundles test file are consistent with the overall system updates. In particular:

  • CoinDecimals: Set to 6 as expected across the code (e.g., in both x/bundles/keeper/keeper_suite_valid_bundles_test.go and x/funders/types/params.go).
  • Funding Thresholds: The values for MinFundingAmount (100_000_000) and MinFundingAmountPerBundle (100_000) in the valid bundles tests match those in the global parameters configuration.
  • Different Test Contexts: Although x/funders/keeper/msg_server_update_params_test.go uses different numerical values for funding amounts, these differences appear intentional for distinct update scenarios and do not indicate a broader inconsistency.

Overall, the updates align with the new decimal and funding requirements.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistency in coin decimal places and funding amounts

# Search for coin decimal declarations
echo "Checking coin decimal declarations..."
rg -A 2 "CoinDecimals.*6" 

# Search for minimum funding amount declarations
echo "Checking minimum funding amounts..."
rg -A 2 "MinFundingAmount.*100_000_000"

# Search for minimum funding per bundle declarations
echo "Checking minimum funding per bundle..."
rg -A 2 "MinFundingAmountPerBundle.*100_000"

Length of output: 5305

x/stakers/keeper/keeper.go Show resolved Hide resolved
@troykessler troykessler self-requested a review February 6, 2025 09:57
@mbreithecker mbreithecker merged commit 1f27380 into main Feb 6, 2025
5 checks passed
@mbreithecker mbreithecker deleted the mbreithecker/test-suite-improvements branch February 6, 2025 09:59
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.

2 participants