github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/x/slashing/spec/05_hooks.md (about)

     1  <!--
     2  order: 5
     3  -->
     4  
     5  # Hooks
     6  
     7  In this section we describe the "hooks" - slashing module code that runs when other events happen.
     8  
     9  ## Validator Bonded
    10  
    11  Upon successful first-time bonding of a new validator, we create a new `ValidatorSigningInfo` structure for the
    12  now-bonded validator, which `StartHeight` of the current block.
    13  
    14  ```
    15  onValidatorBonded(address sdk.ValAddress)
    16  
    17    signingInfo, found = GetValidatorSigningInfo(address)
    18    if !found {
    19      signingInfo = ValidatorSigningInfo {
    20        StartHeight         : CurrentHeight,
    21        IndexOffset         : 0,
    22        JailedUntil         : time.Unix(0, 0),
    23        Tombstone           : false,
    24        MissedBloskCounter  : 0
    25      }
    26      setValidatorSigningInfo(signingInfo)
    27    }
    28    
    29    return
    30  ```