-
Notifications
You must be signed in to change notification settings - Fork 24
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
Keefe Liu
committed
Nov 23, 2022
1 parent
eb1e3eb
commit 7ebbef6
Showing
15 changed files
with
1,863 additions
and
912 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package keeper | ||
|
||
import ( | ||
"fmt" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/x/staking/types" | ||
) | ||
|
||
// CheckCreateProposal checks whether create validator proposal has passed and | ||
// match the current create validator operation. | ||
func (k Keeper) CheckCreateProposal(ctx sdk.Context, msg *types.MsgCreateValidator) error { | ||
_, ok := k.GetProposal(ctx, msg.ProposalId) | ||
if !ok { | ||
return fmt.Errorf("proposal %d does not exist", msg.ProposalId) | ||
} | ||
|
||
// TODO: check the proposal according to the proposal contents. | ||
return nil | ||
} | ||
|
||
// CheckRemoveProposal checks whether remove validator proposal has passed and | ||
// match the current remove validator operation. | ||
func (k Keeper) CheckRemoveProposal(ctx sdk.Context, msg *types.MsgRemoveValidator) error { | ||
_, ok := k.GetProposal(ctx, msg.ProposalId) | ||
if !ok { | ||
return fmt.Errorf("proposal %d does not exist", msg.ProposalId) | ||
} | ||
|
||
// TODO: check the proposal according to the proposal contents. | ||
return nil | ||
} |
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
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
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.