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

Add support for permanent locked vesting accounts #8520

Merged
merged 19 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
18 changes: 18 additions & 0 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@
- [DelayedVestingAccount](#cosmos.vesting.v1beta1.DelayedVestingAccount)
- [Period](#cosmos.vesting.v1beta1.Period)
- [PeriodicVestingAccount](#cosmos.vesting.v1beta1.PeriodicVestingAccount)
- [PermanentLockedVestingAccount](#cosmos.vesting.v1beta1.PermanentLockedVestingAccount)

- [Scalar Value Types](#scalar-value-types)

Expand Down Expand Up @@ -5391,6 +5392,23 @@ QueryVotesResponse is the response type for the Query/Votes RPC method.




<a name="cosmos.vesting.v1beta1.PermanentLockedVestingAccount"></a>

### PermanentLockedVestingAccount
PermanentLockedVestingAccount implements the VestingAccount interface. It does
not ever release coins, locking them indefinitely. Coins in this account can
still be used for delegating and for governance votes even while locked.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `base_vesting_account` | [BaseVestingAccount](#cosmos.vesting.v1beta1.BaseVestingAccount) | | |





<!-- end messages -->

<!-- end enums -->
Expand Down
10 changes: 10 additions & 0 deletions proto/cosmos/vesting/v1beta1/vesting.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,13 @@ message PeriodicVestingAccount {
int64 start_time = 2 [(gogoproto.moretags) = "yaml:\"start_time\""];
repeated Period vesting_periods = 3 [(gogoproto.moretags) = "yaml:\"vesting_periods\"", (gogoproto.nullable) = false];
}

// PermanentLockedVestingAccount implements the VestingAccount interface. It does
// not ever release coins, locking them indefinitely. Coins in this account can
// still be used for delegating and for governance votes even while locked.
message PermanentLockedVestingAccount {
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true];
Copy link
Collaborator

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?

Copy link
Contributor

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.*

}
4 changes: 4 additions & 0 deletions x/auth/vesting/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&ContinuousVestingAccount{}, "cosmos-sdk/ContinuousVestingAccount", nil)
cdc.RegisterConcrete(&DelayedVestingAccount{}, "cosmos-sdk/DelayedVestingAccount", nil)
cdc.RegisterConcrete(&PeriodicVestingAccount{}, "cosmos-sdk/PeriodicVestingAccount", nil)
cdc.RegisterConcrete(&PermanentLockedVestingAccount{}, "cosmos-sdk/PermanentLockedVestingAccount", nil)
}

// RegisterInterface associates protoName with AccountI and VestingAccount
Expand All @@ -28,6 +29,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
&ContinuousVestingAccount{},
&DelayedVestingAccount{},
&PeriodicVestingAccount{},
&PermanentLockedVestingAccount{},
)

registry.RegisterImplementations(
Expand All @@ -36,6 +38,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
&DelayedVestingAccount{},
&ContinuousVestingAccount{},
&PeriodicVestingAccount{},
&PermanentLockedVestingAccount{},
)

registry.RegisterImplementations(
Expand All @@ -44,6 +47,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
&DelayedVestingAccount{},
&ContinuousVestingAccount{},
&PeriodicVestingAccount{},
&PermanentLockedVestingAccount{},
)

registry.RegisterImplementations(
Expand Down
3 changes: 1 addition & 2 deletions x/auth/vesting/types/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ import (
)

var (
app = simapp.Setup(false)
appCodec = simapp.MakeTestEncodingConfig().Marshaler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused var

app = simapp.Setup(false)
)
253 changes: 214 additions & 39 deletions x/auth/vesting/types/vesting.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading