Reset block height for imported authorities
All checks were successful
Integration Tests / test-integration (pull_request) Successful in 2m28s
Build / build (pull_request) Successful in 2m36s
E2E Tests / test-e2e (pull_request) Successful in 4m5s
SDK Tests / sdk_tests_nameservice_expiry (pull_request) Successful in 8m20s
Unit Tests / test-unit (pull_request) Successful in 1m55s
SDK Tests / sdk_tests_authority_auctions (pull_request) Successful in 14m15s
SDK Tests / sdk_tests (pull_request) Successful in 19m22s

This commit is contained in:
Prathamesh Musale 2024-10-24 09:56:46 +05:30
parent 6f75370b17
commit 6c386c00bb

View File

@ -40,6 +40,8 @@ func (k *Keeper) InitGenesis(ctx sdk.Context, data *registry.GenesisState) error
for _, authority := range data.Authorities { for _, authority := range data.Authorities {
// Only import authorities that are marked active. // Only import authorities that are marked active.
if authority.Entry.Status == registry.AuthorityActive { if authority.Entry.Status == registry.AuthorityActive {
// Reset authority height
authority.Entry.Height = uint64(ctx.BlockHeight())
if err := k.SaveNameAuthority(ctx, authority.Name, authority.Entry); err != nil { if err := k.SaveNameAuthority(ctx, authority.Name, authority.Entry); err != nil {
return err return err
} }