Skip to content

Commit

Permalink
wrap more errors
Browse files Browse the repository at this point in the history
  • Loading branch information
danwt committed May 8, 2024
1 parent 9f73ece commit 5e3d6c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions relayer/chains/cosmos/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ func (cc *CosmosProvider) buildMessages(

txf, err := cc.PrepareFactory(cc.TxFactory(), txSignerKey)
if err != nil {
return nil, 0, sdk.Coins{}, err
return nil, 0, sdk.Coins{}, fmt.Errorf("prepare factory: %w", err)
}

if memo != "" {
Expand Down Expand Up @@ -663,11 +663,11 @@ func (cc *CosmosProvider) buildMessages(
// Build the transaction builder
txb, err := txf.BuildUnsignedTx(cMsgs...)
if err != nil {
return nil, 0, sdk.Coins{}, err
return nil, 0, sdk.Coins{}, fmt.Errorf("build unsigned tx: %w", err)
}

if err = tx.Sign(ctx, txf, txSignerKey, txb, false); err != nil {
return nil, 0, sdk.Coins{}, err
return nil, 0, sdk.Coins{}, fmt.Errorf("sign tx: %w", err)
}

tx := txb.GetTx()
Expand All @@ -676,7 +676,7 @@ func (cc *CosmosProvider) buildMessages(
// Generate the transaction bytes
txBytes, err = cc.Cdc.TxConfig.TxEncoder()(tx)
if err != nil {
return nil, 0, sdk.Coins{}, err
return nil, 0, sdk.Coins{}, fmt.Errorf("tx encoder: %w", err)
}

return txBytes, txf.Sequence(), fees, nil
Expand Down

0 comments on commit 5e3d6c2

Please sign in to comment.