[RETRY] Distr-PR-3 More staking hooks (#2404)

* update commission hook for new commission work
* comment update
This commit is contained in:
Rigel
2018-09-25 23:11:57 -07:00
committed by Jae Kwon
parent 2fb3493ff5
commit b54801b4b3
11 changed files with 125 additions and 27 deletions
+19
View File
@@ -0,0 +1,19 @@
## Receiver Hooks
The staking module allow for the following hooks to be registered with staking events:
``` golang
// event hooks for staking validator object
type StakingHooks interface {
OnValidatorCreated(ctx Context, address ValAddress) // called when a validator is created
OnValidatorCommissionChange(ctx Context, address ValAddress) // called when a validator's commission is modified
OnValidatorRemoved(ctx Context, address ValAddress) // called when a validator is deleted
OnValidatorBonded(ctx Context, address ConsAddress) // called when a validator is bonded
OnValidatorBeginUnbonding(ctx Context, address ConsAddress) // called when a validator begins unbonding
OnDelegationCreated(ctx Context, delAddr AccAddress, valAddr ValAddress) // called when a delegation is created
OnDelegationSharesModified(ctx Context, delAddr AccAddress, valAddr ValAddress) // called when a delegation's shares are modified
OnDelegationRemoved(ctx Context, delAddr AccAddress, valAddr ValAddress) // called when a delegation is removed
}
```