Skip to content

Commit

Permalink
fix: add feePayer as signer
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianToledano committed Oct 18, 2024
1 parent aa507fa commit e6a0b03
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions x/tx/decode/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,18 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) {
}
}

// If a fee payer is specified in the AuthInfo, it must be added to the list of signers
if authInfo.Fee.Payer != "" {
feeAddr, err := d.signingCtx.AddressCodec().StringToBytes(authInfo.Fee.Payer)
if err != nil {
return nil, errorsmod.Wrap(ErrTxDecode, err.Error())
}

if _, seen := seenSigners[string(feeAddr)]; !seen {
signers = append(signers, feeAddr)
}
}

return &DecodedTx{
Messages: msgs,
DynamicMessages: dynamicMsgs,
Expand Down

0 comments on commit e6a0b03

Please sign in to comment.