-
Notifications
You must be signed in to change notification settings - Fork 31
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
24 changed files
with
204 additions
and
2,274 deletions.
There are no files selected for viewing
118 changes: 60 additions & 58 deletions
118
api/lbm/stakingplus/v1/authz.pulsar.go → ...takingplus/v1/stakingplus_authz.pulsar.go
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
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
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,76 @@ | ||
package internal | ||
|
||
import ( | ||
"context" | ||
|
||
"cosmossdk.io/math" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" | ||
) | ||
|
||
var _ stakingtypes.StakingHooks = Hooks{} | ||
|
||
// Wrapper struct | ||
type Hooks struct { | ||
k Keeper | ||
} | ||
|
||
// Create new foundation hooks | ||
func (k Keeper) Hooks() Hooks { return Hooks{k} } | ||
|
||
func (h Hooks) AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { | ||
return nil | ||
} | ||
|
||
func (h Hooks) AfterUnbondingInitiated(ctx context.Context, id uint64) error { | ||
return nil | ||
} | ||
|
||
func (h Hooks) AfterValidatorBeginUnbonding(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { | ||
return nil | ||
} | ||
|
||
func (h Hooks) AfterValidatorBonded(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { | ||
return nil | ||
} | ||
|
||
func (h Hooks) AfterValidatorCreated(goCtx context.Context, valAddr sdk.ValAddress) error { | ||
ctx := sdk.UnwrapSDKContext(goCtx) | ||
|
||
grantee := sdk.AccAddress(valAddr) | ||
|
||
msg := stakingtypes.MsgCreateValidator{ | ||
ValidatorAddress: valAddr.String(), | ||
} | ||
|
||
if err := h.k.Accept(ctx, grantee, &msg); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func (h Hooks) AfterValidatorRemoved(ctx context.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { | ||
return nil | ||
} | ||
|
||
func (h Hooks) BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { | ||
return nil | ||
} | ||
|
||
func (h Hooks) BeforeDelegationRemoved(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { | ||
return nil | ||
} | ||
|
||
func (h Hooks) BeforeDelegationSharesModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { | ||
return nil | ||
} | ||
|
||
func (h Hooks) BeforeValidatorModified(ctx context.Context, valAddr sdk.ValAddress) error { | ||
return nil | ||
} | ||
|
||
func (h Hooks) BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error { | ||
return nil | ||
} |
Oops, something went wrong.