From 20dc75701b7cfa9d5d829c7ae47fc334dd626791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Kunze=20K=C3=BCllmer?= <31522760+fedekunze@users.noreply.github.com> Date: Thu, 9 Jun 2022 18:26:07 +0200 Subject: [PATCH] chore(types): add MustAccAddressFromBech32 util func (#12201) --- export.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/export.go b/export.go index 7ecb25f6436b..990a426c4dc0 100644 --- a/export.go +++ b/export.go @@ -85,10 +85,8 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] panic(err) } - delAddr, err := sdk.AccAddressFromBech32(delegation.DelegatorAddress) - if err != nil { - panic(err) - } + delAddr := sdk.MustAccAddressFromBech32(delegation.DelegatorAddress) + _, _ = app.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr) } @@ -122,10 +120,7 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] if err != nil { panic(err) } - delAddr, err := sdk.AccAddressFromBech32(del.DelegatorAddress) - if err != nil { - panic(err) - } + delAddr := sdk.MustAccAddressFromBech32(del.DelegatorAddress) if err := app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr); err != nil { // never called as BeforeDelegationCreated always returns nil