-
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
Add support for permanent locked vesting accounts #8520
Conversation
Not sure we even need to create this sort of thing after genesis, but maybe... Also I'd like to see a more generic way to deal with vesting eventually but that's out of scope. |
@aaronc As it currently stands (on the Regen side atleast), we will not have our Community Staking DAOs setup prior to genesis. It's been my understanding that Regen Foundation would hold all tokens for community staking dao's, and distribute them as the organizations are brought onboard (after mainnet). |
@aaronc I've updated this to remove the |
Codecov Report
@@ Coverage Diff @@
## master #8520 +/- ##
==========================================
+ Coverage 58.80% 58.82% +0.01%
==========================================
Files 583 583
Lines 32749 32769 +20
==========================================
+ Hits 19258 19275 +17
- Misses 11214 11216 +2
- Partials 2277 2278 +1
|
|
||
// require that all vested coins (50%) are spendable plus any received | ||
lockedCoins = cva.LockedCoins(now.Add(12 * time.Hour)) | ||
require.Equal(t, sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}, lockedCoins) | ||
} |
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.
Why were these deleted?
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.
They are copy-pasted from 4 lines above.
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Aaron Craelius <aaron@regen.network>
…inson/permanent-vesting-account
…m/cosmos/cosmos-sdk into clevinson/permanent-vesting-account
@@ -5,6 +5,5 @@ import ( | |||
) | |||
|
|||
var ( | |||
app = simapp.Setup(false) | |||
appCodec = simapp.MakeTestEncodingConfig().Marshaler |
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.
unused var
This PR is r4r again. Would appreciate if @clevinson, @aaronc and @alexanderbez could have a look 🙏 |
option (gogoproto.goproto_getters) = false; | ||
option (gogoproto.goproto_stringer) = false; | ||
|
||
BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; |
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.
we don't need to repeat type name in the attribute name. How about base_account
?
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.
I changed PermanentLockedVestingAccount
to PermanentLockedAccount
, but I disagree with this one: BaseVestingAccount
has a field BaseAccount
. I dont want to do permanentAccount.BaseAccount.BaseAccount.*
In the latest commits, I changed:
@robert-zaremba lmk if that lgty. |
Description
closes: #8283
While the SDK currently supports 3 different types of vesting accounts (delayed, continuous, periodic), it only exposes one Msg for creating vesting accounts, parameterized by a
delayed
boolean, which either creates a "delayed" or "continuous" vesting account.After speaking with @aaronc about this today, I've realized that we don't actually need
sdk.Msg
support for creation ofPermanentLockedVestingAccount
. We discussed a bit the issues with the current vesting logic (as described in #8528), and as a result, i'd like to proceed with the most minimal solution in this PR.This simply adds support for a new
PermanentLockedVestingAccount
type. There shouldn't really be any need for creating these accounts after genesis (as @aaronc noted below). In Regen's own use case, we will setup these accounts to hold locked funds of a Group account (for our Community Staking DAOs), and even with these DAOs not fully realized at genesis, we can instantiate the relevant group accounts and correpsondingPermanentLockedVestingAccount
s at genesis.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.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes