forked from cerc-io/laconicd
Handle record and authority expiry in registry module (#7)
- 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>
This commit is contained in:
@@ -3,15 +3,22 @@ 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 {
|
||||
// TODO: Implement
|
||||
sdkCtx := sdk.UnwrapSDKContext(ctx)
|
||||
|
||||
// k.ProcessRecordExpiryQueue(ctx)
|
||||
// k.ProcessAuthorityExpiryQueue(ctx)
|
||||
if err := k.ProcessRecordExpiryQueue(sdkCtx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := k.ProcessAuthorityExpiryQueue(sdkCtx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -84,6 +84,14 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
Tx: &autocliv1.ServiceCommandDescriptor{
|
||||
Service: registryv1.Msg_ServiceDesc.ServiceName,
|
||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||
{
|
||||
RpcMethod: "RenewRecord",
|
||||
Use: "renew-record [record-id]",
|
||||
Short: "Renew (expired) record",
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
||||
{ProtoField: "record_id"},
|
||||
},
|
||||
},
|
||||
{
|
||||
RpcMethod: "ReserveName",
|
||||
Use: "reserve-name [name] [owner]",
|
||||
|
||||
Reference in New Issue
Block a user