-
Notifications
You must be signed in to change notification settings - Fork 33
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!: Add start time for continuous vesting accounts #342
feat!: Add start time for continuous vesting accounts #342
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v0.46.x-celestia #342 +/- ##
============================================================
+ Coverage 65.54% 65.57% +0.03%
============================================================
Files 666 666
Lines 71161 71177 +16
============================================================
+ Hits 46644 46677 +33
+ Misses 21934 21916 -18
- Partials 2583 2584 +1
|
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) | ||
}, | ||
} | ||
|
||
cmd.Flags().Bool(FlagDelayed, false, "Create a delayed vesting account if true") | ||
cmd.Flags().Int64(FlagStartTime, 0, "Optional start time (as a UNIX epoch timestamp) for continuous vesting accounts. If 0 (default), the block's time of the block this tx is committed to will be used.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment for reviewer:
It's a bit odd that end_time is passed as a mandatory arg but start-time as an optional flag:
create-vesting-account [to_address] [amount] [end_time] --start-time ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
"create a continuous vesting account with start time": { | ||
args: []string{ | ||
sdk.AccAddress("addr2_______________").String(), | ||
sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String(), | ||
"4070908800", | ||
fmt.Sprintf("--%s=%d", cli.FlagStartTime, 4070808800), | ||
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), | ||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), | ||
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), | ||
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), | ||
}, | ||
expectErr: false, | ||
expectedCode: 0, | ||
respType: &sdk.TxResponse{}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a quick test here, but we're not checking that the state really functioned as intented
looking into this now: #342 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] the PR title could use "start time" instead of "start date".
I think this line needs to be updated in the specs:
All vesting accouts created will have their start time set by the committed block's time.
x/auth/vesting/msg_server.go
Outdated
ctx = sdk.UnwrapSDKContext(goCtx) | ||
if err := s.BankKeeper.IsSendEnabledCoins(ctx, msg.Amount...); err != nil { | ||
return nil, err | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] why is this check needed? It appears unrelated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a rebase/merge glitch. This check is done much earlier in this function already!
d33df0b
3176583
to
6729e1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Minimal changes required for: #341
Note:
I had to regenerate proto files and was surprised that this changed a bunch generated code where the proto source wasn't modified 🤔fixedIdeally, the added command-line flag would also be tested in some fashion(see: 3176583 thanks @evan-forbes )Description
Closes: #341
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change