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: add error for all flag with offline, update docs for TerminationAddress #232

Merged
merged 3 commits into from
Nov 24, 2021
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
7 changes: 7 additions & 0 deletions x/farming/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,13 @@ $ %s tx %s harvest --all --from mykey
if !all {
return fmt.Errorf("either staking-coin-denoms or --all flag must be specified")
}

// The transaction cannot be generated offline with --all flag since it
// requires a query to get all the staking denoms.
if clientCtx.Offline {
return fmt.Errorf("cannot generate tx in offline mode with --all flag")
}

queryClient := types.NewQueryClient(clientCtx)
resp, err := queryClient.Stakings(cmd.Context(), &types.QueryStakingsRequest{
Farmer: farmer.String(),
Expand Down
2 changes: 1 addition & 1 deletion x/farming/spec/01_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A public farming plan can be created only through governance proposal.

A private farming plan can be created with any account.

- The account address of the plan creator account is used as the `TerminationAddress`.
- The address of the plan creator account is used as the `TerminationAddress`. When the plan ends after its end time, the balance of the farming pool address is transferred to the termination address.
- To prevent spamming attacks, the `PlanCreationFee` fee must be paid on plan creation.
- Internally, the private plan's farming pool address is derived from the following derivation rule of `address.Module(ModuleName, []byte("PrivatePlan|{planId}|{planName}"))` and it is assigned to the plan.
- After creation, need to query the plan and send the amount of coins to the farming pool address so that the plan distributes as intended.
Expand Down