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: Incorrect error message when periodlimit is not set on a feegrant tx #10050

Merged
merged 22 commits into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c7c07db
improved error message for period limit on fee grant
fkneeland-figure Sep 1, 2021
3880d41
added changelog entry
fkneeland-figure Sep 1, 2021
0286f16
added newline
fkneeland-figure Sep 1, 2021
a8bfb73
Merge branch 'master' into improve_feegrant_error_message
fkneeland-figure Sep 2, 2021
bf679c9
cr fixes
fkneeland-figure Sep 7, 2021
88d16d1
Merge branch 'master' of github.com:cosmos/cosmos-sdk into improve_fe…
fkneeland-figure Sep 7, 2021
28442b4
Merge branch 'improve_feegrant_error_message' of github.com:fkneeland…
fkneeland-figure Sep 7, 2021
26a004d
Update CHANGELOG.md
aleem1314 Sep 8, 2021
e3a087a
Merge branch 'master' into improve_feegrant_error_message
aleem1314 Sep 8, 2021
1adfc3f
updated changelog
fkneeland-figure Sep 8, 2021
4d81433
Merge branch 'master' of github.com:cosmos/cosmos-sdk into improve_fe…
fkneeland-figure Sep 8, 2021
e79e0a5
Merge branch 'improve_feegrant_error_message' of github.com:fkneeland…
fkneeland-figure Sep 8, 2021
9114030
Update x/feegrant/client/cli/tx.go
alexanderbez Sep 9, 2021
115e67f
Update CHANGELOG.md
alexanderbez Sep 9, 2021
d2c4c15
cr fixes
fkneeland-figure Sep 9, 2021
6dd75b4
Merge branch 'improve_feegrant_error_message' of github.com:fkneeland…
fkneeland-figure Sep 9, 2021
60bf318
Merge branch 'master' of github.com:cosmos/cosmos-sdk into improve_fe…
fkneeland-figure Sep 9, 2021
5d868d1
Merge branch 'master' into improve_feegrant_error_message
alexanderbez Sep 9, 2021
aa67555
Merge branch 'master' into improve_feegrant_error_message
fkneeland-figure Sep 9, 2021
4906809
Merge branch 'master' into improve_feegrant_error_message
amaury1093 Sep 14, 2021
8c9d6cf
Merge branch 'master' into improve_feegrant_error_message
alexanderbez Sep 14, 2021
6d2b81e
Merge branch 'master' into improve_feegrant_error_message
fkneeland-figure Sep 14, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [\#9829](https://github.com/cosmos/cosmos-sdk/pull/9829) Fixed Coin denom sorting not being checked during `Balance.Validate` check. Refactored the Validation logic to use `Coins.Validate` for `Balance.Coins`.
+ [\#9965](https://github.com/cosmos/cosmos-sdk/pull/9965) Fixed `simd version` command output to report the right release tag.
+ [\#9980](https://github.com/cosmos/cosmos-sdk/pull/9980) Returning the error when the invalid argument is passed to bank query total supply cli.
* [\#10049](https://github.com/cosmos/cosmos-sdk/issues/10049) Fixed the error message when periodlimit is not set on a feegrant tx
aleem1314 marked this conversation as resolved.
Show resolved Hide resolved

### State Machine Breaking

Expand Down
35 changes: 17 additions & 18 deletions x/feegrant/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,25 +125,24 @@ Examples:
return err
}

if periodClock > 0 && periodLimit != nil {
fkneeland-figure marked this conversation as resolved.
Show resolved Hide resolved
periodReset := getPeriodReset(periodClock)
if exp != "" && periodReset.Sub(expiresAtTime) > 0 {
return fmt.Errorf("period(%d) cannot reset after expiration(%v)", periodClock, exp)
}

periodic := feegrant.PeriodicAllowance{
Basic: basic,
Period: getPeriod(periodClock),
PeriodReset: getPeriodReset(periodClock),
PeriodSpendLimit: periodLimit,
PeriodCanSpend: periodLimit,
}

grant = &periodic

} else {
return fmt.Errorf("invalid number of args %d", len(args))
if periodLimit == nil {
return fmt.Errorf("Period limit was not set")
fkneeland-figure marked this conversation as resolved.
Show resolved Hide resolved
}

periodReset := getPeriodReset(periodClock)
aleem1314 marked this conversation as resolved.
Show resolved Hide resolved
if exp != "" && periodReset.Sub(expiresAtTime) > 0 {
return fmt.Errorf("period(%d) cannot reset after expiration(%v)", periodClock, exp)
alexanderbez marked this conversation as resolved.
Show resolved Hide resolved
}

periodic := feegrant.PeriodicAllowance{
Basic: basic,
Period: getPeriod(periodClock),
PeriodReset: getPeriodReset(periodClock),
PeriodSpendLimit: periodLimit,
PeriodCanSpend: periodLimit,
}

grant = &periodic
}

allowedMsgs, err := cmd.Flags().GetStringSlice(FlagAllowedMsgs)
Expand Down