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: golang compiler bug #1023

Merged
merged 4 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#1011](https://github.com/NibiruChain/nibiru/pull/1011) - feat(perp): add DonateToEF cli command

### Fixes

* [#1023](https://github.com/NibiruChain/nibiru/pull/1023) - collections: golang compiler bug
* [#1017](https://github.com/NibiruChain/nibiru/pull/1017) - collections: correctly reports value type and key in case of not found errors.
* [#857](https://github.com/NibiruChain/nibiru/pull/857) - x/perp add proper stateless genesis validation checks
* [#874](https://github.com/NibiruChain/nibiru/pull/874) - fix --home issue with unsafe-reset-all command, updating tendermint to v0.34.21
Expand Down
11 changes: 6 additions & 5 deletions collections/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ type Map[K, V any] struct {

func NewMap[K, V any](sk sdk.StoreKey, namespace Namespace, kc KeyEncoder[K], vc ValueEncoder[V]) Map[K, V] {
return Map[K, V]{
kc: kc,
vc: vc,
prefix: namespace.Prefix(),
sk: sk,
typeName: vc.Name(),
kc: kc,
vc: vc,
prefix: namespace.Prefix(),
sk: sk,
//nolint
typeName: vc.(ValueEncoder[V]).Name(), // go1.19 compiler bug
}
}

Expand Down
2 changes: 0 additions & 2 deletions x/perp/simulation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ Fluctuation limit ratio:

In our case we only care about the right part since q is always positive (short/long would be the sign).


Trade limit ratio:
------------------

Expand All @@ -124,7 +123,6 @@ Trade limit ratio:
q <= QuoteAssetReserve * tl

with tl the trade limit ratio.

*/
func getMaxQuoteForPool(pool pooltypes.VPool) sdk.Dec {
ratioFloat := math.Sqrt(pool.FluctuationLimitRatio.Add(sdk.OneDec()).MustFloat64())
Expand Down