diff --git a/app/app.go b/app/app.go index fce3ae9b68..fc75cb5c19 100644 --- a/app/app.go +++ b/app/app.go @@ -387,6 +387,8 @@ func New( } } + addressCodec := authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()) + var mpool mempool.Mempool if maxTxs := cast.ToInt(appOpts.Get(server.FlagMempoolMaxTxs)); maxTxs >= 0 { // NOTE we use custom transaction decoder that supports the sdk.Tx interface instead of sdk.StdTx @@ -399,7 +401,7 @@ func New( } else { mpool = mempool.NoOpMempool{} } - blockProposalHandler := NewProposalHandler(txDecoder, identity) + blockProposalHandler := NewProposalHandler(txDecoder, identity, addressCodec) baseAppOptions = append(baseAppOptions, func(app *baseapp.BaseApp) { app.SetMempool(mpool) @@ -486,7 +488,7 @@ func New( runtime.NewKVStoreService(keys[authtypes.StoreKey]), ethermint.ProtoAccount, maccPerms, - authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + addressCodec, sdk.GetConfig().GetBech32AccountAddrPrefix(), authAddr, ) diff --git a/app/proposal.go b/app/proposal.go index 2c439fb548..8a755941c5 100644 --- a/app/proposal.go +++ b/app/proposal.go @@ -64,11 +64,12 @@ type ProposalHandler struct { addressCodec address.Codec } -func NewProposalHandler(txDecoder sdk.TxDecoder, identity age.Identity) *ProposalHandler { +func NewProposalHandler(txDecoder sdk.TxDecoder, identity age.Identity, addressCodec address.Codec) *ProposalHandler { return &ProposalHandler{ - TxDecoder: txDecoder, - Identity: identity, - blocklist: make(map[string]struct{}), + TxDecoder: txDecoder, + Identity: identity, + blocklist: make(map[string]struct{}), + addressCodec: addressCodec, } }