diff --git a/x/ibchooks/marker_hooks.go b/x/ibchooks/marker_hooks.go index b3a868144d..67c657c2c9 100644 --- a/x/ibchooks/marker_hooks.go +++ b/x/ibchooks/marker_hooks.go @@ -96,7 +96,7 @@ func (h MarkerHooks) createNewIbcMarker(ctx sdktypes.Context, data transfertypes allowForceTransfer, []string{}, ) - h.adjustSupply(ctx, marker) + h.getExistingSupply(ctx, marker) if err = ResetMarkerAccessGrants(transferAuthAddrs, marker); err != nil { return err } @@ -106,8 +106,9 @@ func (h MarkerHooks) createNewIbcMarker(ctx sdktypes.Context, data transfertypes return h.addDenomMetaData(ctx, packet, ibcKeeper, ibcDenom, data) } -// adjustSupply updates marker account's supply, this ensures the supply is correct for ibc coins that may exist before a marker is created -func (h MarkerHooks) adjustSupply(ctx sdktypes.Context, marker *markertypes.MarkerAccount) { +// getExistingSupply updates marker account's supply, this ensures the supply is correct for ibc coins that may exist before a marker is created. +// The current circulation will be 0 if the ibc coin does not exist yet. +func (h MarkerHooks) getExistingSupply(ctx sdktypes.Context, marker *markertypes.MarkerAccount) { currentSupply := h.MarkerKeeper.CurrentCirculation(ctx, marker) marker.SetSupply(marker.GetSupply().Add(sdktypes.NewCoin(marker.Denom, currentSupply))) }