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

sdk 46 rc2 #16

Closed
Closed

Conversation

faddat
Copy link
Contributor

@faddat faddat commented May 27, 2022

Description

Hey guys, I think that I made most of the changes successfully.

That said, I am not sure how to apply cosmossdk.io/math to


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@@ -88,7 +89,7 @@ func GetOfferCoinFee(offerCoin sdk.Coin, swapFeeRate sdk.Dec) sdk.Coin {
}
// apply half-ratio swap fee rate and ceiling
// see https://github.com/tendermint/liquidity/issues/41 for details
return sdk.NewCoin(offerCoin.Denom, offerCoin.Amount.ToDec().Mul(swapFeeRate.QuoInt64(2)).Ceil().TruncateInt()) // Ceil(offerCoin.Amount * (swapFeeRate/2))
return sdk.NewCoin(offerCoin.Denom, math.Dec(offerCoin.Amount.Mul(swapFeeRate.QuoInt64(2)).Ceil().TruncateInt())) // Ceil(offerCoin.Amount * (swapFeeRate/2)) NOTE: I COULD HAVE MADE A BUG HERE IN THE DECIMAL CONVERSION.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the line I am unsure of, sorry 'bout that.

Definitely wanted to flag it, too, looks like it's an important one. basically, it is now looking for an cosmosdk.io/math.Int

@faddat faddat changed the title prepare for sdk v46 post middleware changes with return of antehandler. sdk 46 with ibc-go v4 Jul 9, 2022
@faddat faddat changed the title sdk 46 with ibc-go v4 sdk 46 rc2 Jul 9, 2022
@dongsam
Copy link
Collaborator

dongsam commented Jul 11, 2022

Hi @faddat, Thanks for the PR,
The Math package is still beta and is not actively used in other sdk modules of rc2, so it is hesitant to apply it to the liquidity module, I just pushed sdk 0.46.0-rc2 bump commit on #15

@dongsam dongsam closed this Jul 11, 2022
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