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

feat: RewardAllocation accepts target denom #376

Merged
merged 4 commits into from
Oct 20, 2022

Conversation

hallazzang
Copy link
Contributor

Description

RewardAllocation in a Plan can now specify target Denom.
This change makes the migration of old farming plans from x/farming possible.

Tasks

  • Write tests
  • Update docs

References


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.

  • Appropriate labels applied
  • Targeted PR against correct branch
  • 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
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@hallazzang hallazzang self-assigned this Oct 16, 2022
@github-actions github-actions bot added c-sync documentation Improvements or additions to documentation x/farm labels Oct 16, 2022
@hallazzang hallazzang marked this pull request as ready for review October 18, 2022 07:09
Copy link
Contributor

@jaybxyz jaybxyz left a comment

Choose a reason for hiding this comment

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

Great work! LGTM. Can you please pull the latest commit from main branch? I left a single comment that is for a reminder.

@@ -84,19 +85,25 @@ $ %s tx %s create-private-plan "New Farming Plan" 2022-01-01T00:00:00Z 2023-01-0
var rewardAllocs []types.RewardAllocation
for _, arg := range args[3:] {
// TODO: use strings.Cut with go 1.18
Copy link
Contributor

Choose a reason for hiding this comment

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

As we just upgraded go version to 1.18, I think we can use strings.Cut if you pull the latest main branch. I am leaving this comment for a reminder. You can tackle this in a separate PR.

@jaybxyz
Copy link
Contributor

jaybxyz commented Oct 18, 2022

I am not too sure why, but I encounter an error when I try to start a local network using ignite. It works well with the main branch. Maybe if you pull the latest commit from main branch, it will resolve the issue.

This is the error message that I encounter.

[STARPORT] Cosmos SDK's version is: stargate - v0.45.3
[STARPORT] 
[STARPORT] 🔄 Resetting the app state...
[STARPORT] 🛠️  Building proto...
[STARPORT] 📦 Installing dependencies...
[STARPORT] cannot build app:
[STARPORT] 
[STARPORT]      error while running command go mod tidy: github.com/cosmosquad-labs/squad/v3/app imports
[STARPORT]      github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1 imports
[STARPORT]      golang.org/x/crypto/ripemd160 loaded from golang.org/x/crypto@v0.0.0-20210915214749-c084706c2272,
[STARPORT]      but go 1.16 would select v0.0.0-20210921155107-089bfa567519
[STARPORT] github.com/cosmosquad-labs/squad/v3/app imports
[STARPORT]      github.com/cosmos/cosmos-sdk/x/genutil imports
[STARPORT]      github.com/cosmos/go-bip39 imports
[STARPORT]      golang.org/x/crypto/pbkdf2 loaded from golang.org/x/crypto@v0.0.0-20210915214749-c084706c2272,
[STARPORT]      but go 1.16 would select v0.0.0-20210921155107-089bfa567519
[STARPORT] github.com/cosmosquad-labs/squad/v3/app imports
[STARPORT]      github.com/cosmos/cosmos-sdk/x/genutil imports
[STARPORT]      github.com/tendermint/tendermint/crypto/ed25519 imports
[STARPORT]      golang.org/x/crypto/ed25519 loaded from golang.org/x/crypto@v0.0.0-20210915214749-c084706c2272,
[STARPORT]      but go 1.16 would select v0.0.0-20210921155107-089bfa567519
...
......
STARPORT] github.com/cosmosquad-labs/squad/v3/cmd/squad/cmd imports
[STARPORT]      github.com/cosmos/cosmos-sdk/crypto/keyring imports
[STARPORT]      github.com/cosmos/cosmos-sdk/crypto imports
[STARPORT]      github.com/tendermint/tendermint/crypto/xsalsa20symmetric tested by
[STARPORT]      github.com/tendermint/tendermint/crypto/xsalsa20symmetric.test imports
[STARPORT]      golang.org/x/crypto/bcrypt loaded from golang.org/x/crypto@v0.0.0-20210915214749-c084706c2272,
[STARPORT]      but go 1.16 would select v0.0.0-20210921155107-089bfa567519
[STARPORT] 
[STARPORT] To upgrade to the versions selected by go 1.16:
[STARPORT]      go mod tidy -go=1.16 && go mod tidy -go=1.17
[STARPORT] If reproducibility with go 1.16 is not needed:
[STARPORT]      go mod tidy -compat=1.17
[STARPORT] For other options, see:
[STARPORT]      https://golang.org/doc/modules/pruning
[STARPORT] : exit status 1
[STARPORT] Waiting for a fix before retrying...

@hallazzang
Copy link
Contributor Author

I am not too sure why, but I encounter an error when I try to start a local network using ignite. It works well with the main branch. Maybe if you pull the latest commit from main branch, it will resolve the issue.

This is the error message that I encounter.

[STARPORT] Cosmos SDK's version is: stargate - v0.45.3
[STARPORT] 
[STARPORT] 🔄 Resetting the app state...
[STARPORT] 🛠️  Building proto...
[STARPORT] 📦 Installing dependencies...
[STARPORT] cannot build app:
[STARPORT] 
[STARPORT]      error while running command go mod tidy: github.com/cosmosquad-labs/squad/v3/app imports
[STARPORT]      github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1 imports
[STARPORT]      golang.org/x/crypto/ripemd160 loaded from golang.org/x/crypto@v0.0.0-20210915214749-c084706c2272,
[STARPORT]      but go 1.16 would select v0.0.0-20210921155107-089bfa567519
[STARPORT] github.com/cosmosquad-labs/squad/v3/app imports
[STARPORT]      github.com/cosmos/cosmos-sdk/x/genutil imports
[STARPORT]      github.com/cosmos/go-bip39 imports
[STARPORT]      golang.org/x/crypto/pbkdf2 loaded from golang.org/x/crypto@v0.0.0-20210915214749-c084706c2272,
[STARPORT]      but go 1.16 would select v0.0.0-20210921155107-089bfa567519
[STARPORT] github.com/cosmosquad-labs/squad/v3/app imports
[STARPORT]      github.com/cosmos/cosmos-sdk/x/genutil imports
[STARPORT]      github.com/tendermint/tendermint/crypto/ed25519 imports
[STARPORT]      golang.org/x/crypto/ed25519 loaded from golang.org/x/crypto@v0.0.0-20210915214749-c084706c2272,
[STARPORT]      but go 1.16 would select v0.0.0-20210921155107-089bfa567519
...
......
STARPORT] github.com/cosmosquad-labs/squad/v3/cmd/squad/cmd imports
[STARPORT]      github.com/cosmos/cosmos-sdk/crypto/keyring imports
[STARPORT]      github.com/cosmos/cosmos-sdk/crypto imports
[STARPORT]      github.com/tendermint/tendermint/crypto/xsalsa20symmetric tested by
[STARPORT]      github.com/tendermint/tendermint/crypto/xsalsa20symmetric.test imports
[STARPORT]      golang.org/x/crypto/bcrypt loaded from golang.org/x/crypto@v0.0.0-20210915214749-c084706c2272,
[STARPORT]      but go 1.16 would select v0.0.0-20210921155107-089bfa567519
[STARPORT] 
[STARPORT] To upgrade to the versions selected by go 1.16:
[STARPORT]      go mod tidy -go=1.16 && go mod tidy -go=1.17
[STARPORT] If reproducibility with go 1.16 is not needed:
[STARPORT]      go mod tidy -compat=1.17
[STARPORT] For other options, see:
[STARPORT]      https://golang.org/doc/modules/pruning
[STARPORT] : exit status 1
[STARPORT] Waiting for a fix before retrying...

This issue has been resolved after merging main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation x/farm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants