From 4e03eaa85e8862b9c5e98146e2baf20b57a90503 Mon Sep 17 00:00:00 2001 From: Sai Krishna Sunkari Date: Fri, 17 Mar 2023 19:29:39 +0530 Subject: [PATCH] fix: sdkmath type in PoolSnapshot (#536) ## Description Closes: #XXXX typo fixes --- ### 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... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch - [ ] provided a link to the relevant issue or specification - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers 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... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- .github/workflows/test.yml | 2 +- CHANGELOG.md | 3 ++- go.mod | 2 +- types/staking_pool_params.go | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e25e23143..87abb6540 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: 1.18 - name: Test & Create coverage report run: make install test-unit stop-docker-test - name: Upload cove coverage diff --git a/CHANGELOG.md b/CHANGELOG.md index fe1931d68..d5983273e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ #### Staking Module - ([\#443](https://github.com/forbole/bdjuno/pull/443)) Remove tombstone status from staking module(already stored in slashing module) - ([\#455](https://github.com/forbole/bdjuno/pull/455)) Added `unbonding_tokens` and `staked_not_bonded_tokens` values to staking pool table +- ([\#536](https://github.com/forbole/bdjuno/pull/536) Fix `PoolSnapshot` tokens type from `sdk.Int` to `sdkmath.Int` #### Gov Module - ([\#461](https://github.com/forbole/bdjuno/pull/461)) Parse `x/gov` genesis with `genesisDoc.InitialHeight` instead of the hard-coded height 1 @@ -130,4 +131,4 @@ This version introduces breaking changes to certain address-specific data that i - ([\#276](https://github.com/forbole/bdjuno/pull/276)) Added `fee_grant_allowance` table (v0.44.x) #### Modules -- ([\#353](https://github.com/forbole/bdjuno/pull/353)) Removed the support for the `history` module \ No newline at end of file +- ([\#353](https://github.com/forbole/bdjuno/pull/353)) Removed the support for the `history` module diff --git a/go.mod b/go.mod index e4759c825..79b4cc578 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/forbole/bdjuno/v4 -go 1.19 +go 1.18 require ( cosmossdk.io/math v1.0.0-beta.3 diff --git a/types/staking_pool_params.go b/types/staking_pool_params.go index 845321d53..ca6e5cab7 100644 --- a/types/staking_pool_params.go +++ b/types/staking_pool_params.go @@ -27,13 +27,13 @@ func NewPool(bondedTokens, notBondedTokens, unbondingTokens, stakedNotBondedToke // PoolSnapshot contains the data of the staking pool snapshot at the given height type PoolSnapshot struct { - BondedTokens sdk.Int - NotBondedTokens sdk.Int + BondedTokens sdkmath.Int + NotBondedTokens sdkmath.Int Height int64 } // NewPoolSnapshot allows to build a new PoolSnapshot instance -func NewPoolSnapshot(bondedTokens, notBondedTokens sdk.Int, height int64) *PoolSnapshot { +func NewPoolSnapshot(bondedTokens, notBondedTokens sdkmath.Int, height int64) *PoolSnapshot { return &PoolSnapshot{ BondedTokens: bondedTokens, NotBondedTokens: notBondedTokens,