refactor!: create math go sub module#11788
Conversation
|
@aaronc we need to duplicate // ToDec converts Int to Dec
func (i Int) ToDec() Dec {
return NewDecFromInt(i)
}Should we:
(1) allows use to avoid copying |
tac0turtle
left a comment
There was a problem hiding this comment.
should we alias the math package from types for a release and mark as deprecated, similar to errors
Yes :) |
I chatted with @alexanderbez about this a bit, but the idea is to keep the gogo proto and amino serialization in |
What I'd propose for So in type Int math.Int
func (i Int) ToDec() Dec {
return NewDecFromInt(i)
}I'd prefer to avoid API breakage in |
… into bez/11784-math-sub-mod
aaronc
left a comment
There was a problem hiding this comment.
Why did you decide to not create an Int wrapper type with the Dec method defined?
Otherwise LGTM
Yes, correct. That one API was just not worth it -- a caller can and should just call |
Description
Closes: #11784
mathgo sub-moduleInt, andUinttypes tomathtypes/math.goInt#ToDec(API breaking)A beta release/tag of
mathwill be made along with thereplacedirective being removed once this PR is merged.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.mdReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!in the type prefix if API or client breaking change