Skip to content

Commit

Permalink
Merge branch 'master' into sikka/governance-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnya97 authored Apr 21, 2021
2 parents 1d1530d + 603e895 commit 24e5109
Show file tree
Hide file tree
Showing 9 changed files with 503 additions and 123 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
if: env.GIT_DIFF
- uses: codecov/codecov-action@v1.4.0
- uses: codecov/codecov-action@v1.4.1
with:
file: ./coverage.txt
if: env.GIT_DIFF
Expand Down
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)
- [PermanentLockedAccount](#cosmos.vesting.v1beta1.PermanentLockedAccount)

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

Expand Down Expand Up @@ -8192,6 +8193,23 @@ periodically vests by unlocking coins during each specified period.




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

### PermanentLockedAccount
PermanentLockedAccount 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];
}

// PermanentLockedAccount 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 PermanentLockedAccount {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true];
}
3 changes: 2 additions & 1 deletion x/auth/vesting/exported/exported.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import (
type VestingAccount interface {
types.AccountI

// LockedCoins returns the set of coins that are not spendable (i.e. locked).
// LockedCoins returns the set of coins that are not spendable (i.e. locked),
// defined as the vesting coins that are not delegated.
//
// To get spendable coins of a vesting account, first the total balance must
// be retrieved and the locked tokens can be subtracted from the total balance.
Expand Down
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(&PermanentLockedAccount{}, "cosmos-sdk/PermanentLockedAccount", nil)
}

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

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

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

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
app = simapp.Setup(false)
)
251 changes: 213 additions & 38 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

0 comments on commit 24e5109

Please sign in to comment.