Skip to content

fix: incorrect multiplication in provConsumerModifiedGenesis #2595

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

santamasa
Copy link

chainsuite.ProviderUnbondingTime is most likely a time.Duration, but it's being multiplied by 10000000 before converting to a string. This results in an incorrect value in the genesis config.

Instead of multiplying, it's better to use .Nanoseconds() to get the correct format:

Before:

cosmos.NewGenesisKV("app_state.staking.params.unbonding_time", (chainsuite.ProviderUnbondingTime * 10000000).String()),

After:

cosmos.NewGenesisKV("app_state.staking.params.unbonding_time", strconv.FormatInt(chainsuite.ProviderUnbondingTime.Nanoseconds(), 10)),

This ensures the unbonding time is correctly serialized in nanoseconds.

@santamasa santamasa requested a review from a team April 2, 2025 08:37
@github-actions github-actions bot added the C:Testing Assigned automatically by the PR labeler label Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Testing Assigned automatically by the PR labeler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant