Skip to content

fix(oracle): use ConsensusVersion constant instead of hardcoded value#257

Merged
jhelison merged 1 commit into
KiiChain:mainfrom
catsmile100:fix/oracle-consensus-version
Jan 27, 2026
Merged

fix(oracle): use ConsensusVersion constant instead of hardcoded value#257
jhelison merged 1 commit into
KiiChain:mainfrom
catsmile100:fix/oracle-consensus-version

Conversation

@catsmile100

Copy link
Copy Markdown
Contributor

Description

Found this weird bug in oracle module. There's a constant ConsensusVersion = 1 defined but it's never used anywhere. The function just returns hardcoded 6 instead.

The problem:

  • Line 31: const ConsensusVersion = 1 (just sitting there doing nothing)
  • Line 168: func (AppModule) ConsensusVersion() uint64 { return 6 } (why hardcode this?)

What I changed:

  • Updated the constant from 1 to 6 (so it matches what the function should return)
  • Made the function actually use the constant instead of hardcoding

Now it's consistent with other modules like tokenfactory, rewards, and feeabstraction that properly use their ConsensusVersion constants.

Fixes #256

Type of change

  • Bug fix (code quality improvement)

How Has This Been Tested?

  • Checked that constant now matches what function returns
  • Built successfully, no issues
  • Compared with other modules to make sure it's consistent

Checklist:

  • Added to changelog
  • Follows same pattern as other modules

Fixes KiiChain#256

- Update ConsensusVersion constant from 1 to 6
- Change ConsensusVersion() function to return the constant
- Makes oracle module consistent with other modules
@catsmile100 catsmile100 requested a review from jhelison as a code owner January 27, 2026 20:13
@coderabbitai

coderabbitai Bot commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request fixes an inconsistency in the oracle module where the ConsensusVersion constant was defined as 1 but the ConsensusVersion() method returned a hardcoded value of 6. The changes update the constant to 6 and modify the method to return the constant instead of the hardcoded literal, bringing the implementation in line with other modules in the codebase. A changelog entry documenting this fix was also added.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: using the ConsensusVersion constant instead of a hardcoded value in the oracle module.
Description check ✅ Passed The description is directly related to the changeset, explaining the inconsistency between the unused constant and the hardcoded return value, and detailing the changes made.
Linked Issues check ✅ Passed The pull request fully addresses the requirements in issue #256: the ConsensusVersion constant is updated from 1 to 6, and the function now returns this constant instead of a hardcoded value.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue #256. The updates to the constant value and function implementation, plus the changelog entry, are all within scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jhelison jhelison merged commit 6dbf316 into KiiChain:main Jan 27, 2026
8 checks passed
@codecov

codecov Bot commented Jan 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
x/oracle/module.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

[BUG] Oracle Module ConsensusVersion Constant Not Used

2 participants