-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from sunriselayer/fix/sunrise-lockup-account
fix: sunrise-lockup-account
- Loading branch information
Showing
11 changed files
with
4,216 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
proto/sunrise/accounts/self_delegatable_lockup/v1/lockup.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
syntax = "proto3"; | ||
package sunrise.accounts.self_delegatable_lockup.v1; | ||
|
||
import "amino/amino.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/duration.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
|
||
option go_package = "github.com/sunriselayer/sunrise/x/accounts/self_delegatable_lockup/v1"; | ||
|
||
// Period defines a length of time and amount of coins that will be lock. | ||
message Period { | ||
// Period duration | ||
google.protobuf.Duration length = 1 [ | ||
(gogoproto.nullable) = false, | ||
(amino.dont_omitempty) = true, | ||
(gogoproto.stdduration) = true | ||
]; | ||
repeated cosmos.base.v1beta1.Coin amount = 2 [ | ||
(gogoproto.nullable) = false, | ||
(amino.dont_omitempty) = true, | ||
(amino.encoding) = "legacy_coins", | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" | ||
]; | ||
} | ||
|
||
message UnbondingEntries { | ||
repeated UnbondingEntry entries = 1; | ||
} | ||
|
||
// UnbondingEntry defines an entry tracking the lockup account unbonding operation. | ||
message UnbondingEntry { | ||
int64 creation_height = 1; | ||
// end time of entry | ||
google.protobuf.Timestamp end_time = 2 [ | ||
(gogoproto.nullable) = false, | ||
(amino.dont_omitempty) = true, | ||
(gogoproto.stdtime) = true | ||
]; | ||
// unbond amount | ||
cosmos.base.v1beta1.Coin amount = 3 [ | ||
(gogoproto.nullable) = false, | ||
(amino.dont_omitempty) = true | ||
]; | ||
// validator address | ||
string validator_address = 4 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; | ||
} |
86 changes: 86 additions & 0 deletions
86
proto/sunrise/accounts/self_delegatable_lockup/v1/query.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
syntax = "proto3"; | ||
package sunrise.accounts.self_delegatable_lockup.v1; | ||
|
||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
import "sunrise/accounts/self_delegatable_lockup/v1/lockup.proto"; | ||
|
||
option go_package = "github.com/sunriselayer/sunrise/x/accounts/self_delegatable_lockup/v1"; | ||
|
||
// QueryLockupAccountInfoRequest get lockup account info | ||
message QueryLockupAccountInfoRequest {} | ||
|
||
// QueryLockupAccountInfoResponse return lockup account info | ||
message QueryLockupAccountInfoResponse { | ||
// original_locking defines the value of the account original locking coins. | ||
repeated cosmos.base.v1beta1.Coin original_locking = 1 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" | ||
]; | ||
|
||
// delegated_free defines the value of the account free delegated amount. | ||
repeated cosmos.base.v1beta1.Coin delegated_free = 2 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" | ||
]; | ||
|
||
// delegated_locking defines the value of the account locking delegated amount. | ||
repeated cosmos.base.v1beta1.Coin delegated_locking = 3 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" | ||
]; | ||
|
||
// end_time defines the value of the account lockup start time. | ||
google.protobuf.Timestamp start_time = 4 [(gogoproto.stdtime) = true]; | ||
|
||
// end_time defines the value of the account lockup end time. | ||
google.protobuf.Timestamp end_time = 5 [(gogoproto.stdtime) = true]; | ||
|
||
// locked_coins defines the value of the account locking coins. | ||
repeated cosmos.base.v1beta1.Coin locked_coins = 6 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" | ||
]; | ||
|
||
// unlocked_coins defines the value of the account released coins from lockup. | ||
repeated cosmos.base.v1beta1.Coin unlocked_coins = 7 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" | ||
]; | ||
|
||
// owner defines the value of the owner of the lockup account. | ||
string owner = 8; | ||
} | ||
|
||
// QueryUnbondingEntriesRequest is used to query the lockup account unbonding entries. | ||
message QueryUnbondingEntriesRequest { | ||
string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; | ||
} | ||
|
||
// QueryUnbondingEntriesResponse returns the lockup account unbonding entries. | ||
message QueryUnbondingEntriesResponse { | ||
// UnbondingEntry defines the list of unbonding entries. | ||
repeated UnbondingEntry unbonding_entries = 1; | ||
} | ||
|
||
// QueryLockingPeriodsRequest is used to query the periodic lockup account locking periods. | ||
message QueryLockingPeriodsRequest {} | ||
|
||
// QueryLockingPeriodsResponse returns the periodic lockup account locking periods. | ||
message QueryLockingPeriodsResponse { | ||
// lockup_periods defines the value of the periodic lockup account locking periods. | ||
repeated Period locking_periods = 1; | ||
} | ||
|
||
// QuerySpendableAmountRequest is used to query the lockup account total spendable tokens. | ||
message QuerySpendableAmountRequest {} | ||
|
||
// QuerySpendableAmountResponse returns lockup account total spendable tokens. | ||
message QuerySpendableAmountResponse { | ||
repeated cosmos.base.v1beta1.Coin spendable_tokens = 1 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.