-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 #17810
Conversation
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.
Thanks for this change @cmwaters! I've added some comments that'll improve the dynamic scaling of time periods and allow you to easily check spendability or vesting
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.
utACK!
@@ -70,8 +74,12 @@ func (s msgServer) CreateVestingAccount(ctx context.Context, msg *types.MsgCreat | |||
if msg.Delayed { | |||
vestingAccount = types.NewDelayedVestingAccountRaw(baseVestingAccount) | |||
} else { | |||
sdkctx := sdk.UnwrapSDKContext(ctx) | |||
vestingAccount = types.NewContinuousVestingAccountRaw(baseVestingAccount, sdkctx.HeaderInfo().Time.Unix()) | |||
start := msg.StartTime |
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.
Actually, we should add a check that it does not start in the past and that start is a valid time ( >= 0)
Missing the <= 0 check for instance.
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.
Whats the effect of starting at the past? That instantly a portion will be vested right?
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, but that is a weird use case. Avoiding starting in the past can avoid people making fat-finger mistakes.
Co-authored-by: Julien Robert <[email protected]>
@julienrbrt @tac0turtle which Cosmos SDK releases was this included in? I couldn't find it in the changelog. |
Description
This is a cherry-pick from celestiaorg#342 based on this comment here #4287 (comment). It allows for a vesting account to start at some future defined start time
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
make lint
andmake test
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