Prathamesh Musale
d2339e2426
- Registry module - Update module state to track record / authority expiry queues - Handle expired records and authorities at the end of each block - Add a command to handle record renewal Reviewed-on: deep-stack/laconic2d#7 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
25 lines
440 B
Go
25 lines
440 B
Go
package module
|
|
|
|
import (
|
|
"context"
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
"git.vdb.to/cerc-io/laconic2d/x/registry/keeper"
|
|
)
|
|
|
|
// EndBlocker is called every block
|
|
func EndBlocker(ctx context.Context, k keeper.Keeper) error {
|
|
sdkCtx := sdk.UnwrapSDKContext(ctx)
|
|
|
|
if err := k.ProcessRecordExpiryQueue(sdkCtx); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := k.ProcessAuthorityExpiryQueue(sdkCtx); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|