-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
366 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
syntax = "proto3"; | ||
package centauri.stakingmiddleware.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "x/stakingmiddleware/types"; | ||
|
||
// GenesisState defines the stakingmiddleware module's genesis state. | ||
message GenesisState { | ||
// last_total_power tracks the total amounts of bonded tokens recorded during | ||
// the previous end block. | ||
bytes last_total_power = 1 [ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,29 @@ | ||
package types | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/address" | ||
) | ||
|
||
// MinterKey is the key to use for the keeper store. | ||
var ( | ||
DelegationKey = []byte{0x01} // key for a delegation | ||
) | ||
|
||
const ( | ||
// module name | ||
ModuleName = "mint" | ||
|
||
// StoreKey is the default store key for mint | ||
StoreKey = ModuleName | ||
) | ||
|
||
// GetDelegationKey creates the key for delegator bond with validator | ||
// VALUE: staking/Delegation | ||
func GetDelegationKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte { | ||
return append(GetDelegationsKey(delAddr), address.MustLengthPrefix(valAddr)...) | ||
} | ||
|
||
func GetDelegationsKey(delAddr sdk.AccAddress) []byte { | ||
return append(DelegationKey, address.MustLengthPrefix(delAddr)...) | ||
} |