From 118d8693d4ac5dc53358a3dfc374f8ad3c736094 Mon Sep 17 00:00:00 2001 From: C H Date: Wed, 21 Aug 2024 17:17:53 +0800 Subject: [PATCH] Added root denom as denom unit of boot --- app/upgrades/v4/upgrades.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/upgrades/v4/upgrades.go b/app/upgrades/v4/upgrades.go index 7b10b709..fe9cbf96 100644 --- a/app/upgrades/v4/upgrades.go +++ b/app/upgrades/v4/upgrades.go @@ -141,6 +141,17 @@ func CreateV4UpgradeHandler( } logger.Info("set clock params") + bootDenom, exist := keepers.BankKeeper.GetDenomMetaData(ctx, "boot") + if exist { + bootDenom.DenomUnits = append(bootDenom.DenomUnits, &banktypes.DenomUnit{ + Denom: "root", + Exponent: 9, + Aliases: []string{"ROOT"}, + }) + keepers.BankKeeper.SetDenomMetaData(ctx, bootDenom) + logger.Info("update boot denom metadata with root token") + } + after := time.Now() ctx.Logger().Info("migration time", "duration_ms", after.Sub(before).Milliseconds())