-
Notifications
You must be signed in to change notification settings - Fork 181
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 #524 from maticnetwork/jdkanani/staking-fix-1
- Loading branch information
Showing
8 changed files
with
251 additions
and
194 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package app | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
"github.com/maticnetwork/heimdall/types" | ||
) | ||
|
||
// ModuleCommunicator retriever | ||
type ModuleCommunicator struct { | ||
App *HeimdallApp | ||
} | ||
|
||
// GetACKCount returns ack count | ||
func (d ModuleCommunicator) GetACKCount(ctx sdk.Context) uint64 { | ||
return d.App.CheckpointKeeper.GetACKCount(ctx) | ||
} | ||
|
||
// IsCurrentValidatorByAddress check if validator is current validator | ||
func (d ModuleCommunicator) IsCurrentValidatorByAddress(ctx sdk.Context, address []byte) bool { | ||
return d.App.StakingKeeper.IsCurrentValidatorByAddress(ctx, address) | ||
} | ||
|
||
// GetAllDividendAccounts fetches all dividend accounts from topup module | ||
func (d ModuleCommunicator) GetAllDividendAccounts(ctx sdk.Context) []*types.DividendAccount { | ||
return d.App.TopupKeeper.GetAllDividendAccounts(ctx) | ||
} | ||
|
||
// GetValidatorFromValID get validator from validator id | ||
func (d ModuleCommunicator) GetValidatorFromValID(ctx sdk.Context, valID types.ValidatorID) (validator types.Validator, ok bool) { | ||
return d.App.StakingKeeper.GetValidatorFromValID(ctx, valID) | ||
} | ||
|
||
// CreateValiatorSigningInfo creates ValidatorSigningInfo used by slashing module | ||
func (d ModuleCommunicator) CreateValiatorSigningInfo(ctx sdk.Context, valID types.ValidatorID, valSigningInfo types.ValidatorSigningInfo) { | ||
return | ||
} |
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.