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

fix: OracleCommissionRate upper limit #553

Merged
merged 3 commits into from
Dec 15, 2022
Merged

fix: OracleCommissionRate upper limit #553

merged 3 commits into from
Dec 15, 2022

Conversation

0xHansLee
Copy link
Contributor

close #551

@0xHansLee 0xHansLee added the bug Something isn't working label Dec 14, 2022
@0xHansLee 0xHansLee self-assigned this Dec 14, 2022
Copy link
Contributor

@gyuguen gyuguen left a comment

Choose a reason for hiding this comment

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

LGTM
I left one comment.

@@ -94,6 +94,10 @@ func (m *OracleRegistration) ValidateBasic() error {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "OracleCommissionMaxRate must be between 0 and 1")
}

if m.OracleCommissionRate.GT(m.OracleCommissionMaxRate) {
Copy link
Contributor

@gyuguen gyuguen Dec 15, 2022

Choose a reason for hiding this comment

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

I think we can change like below.(line: 89)

if m.OracleCommissionRate.LT(sdk.ZeroDec()) || m.OracleCommissionRate.GT(m.OracleCommissionMaxRate) {
	return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "oracleCommissionRate must be between 0 and 'OracleCommissionMaxRate'")
}

How about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. It looks better. I'll change it

Copy link
Contributor

@audtlr24 audtlr24 left a comment

Choose a reason for hiding this comment

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

Good, Thanks.

@youngjoon-lee youngjoon-lee merged commit 746d212 into main Dec 15, 2022
@youngjoon-lee youngjoon-lee deleted the fix/551 branch December 15, 2022 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add upper limit to OracleCommissionRate in MsgRegisterOracle
4 participants