Skip to content

Commit 064ae5e

Browse files
committed
(fix) Fixed pre-commit errors in imports and lint validations
1 parent c16c302 commit 064ae5e

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

client/chain/chain.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -880,14 +880,18 @@ func (c *chainClient) runBatchBroadcast() {
880880
submitBatch := func(toSubmit []sdk.Msg) {
881881
res, err := c.SyncBroadcastMsg(toSubmit...)
882882

883-
if res.TxResponse.Code != 0 {
884-
err = errors.Errorf("error %d (%s): %s", res.TxResponse.Code, res.TxResponse.Codespace, res.TxResponse.RawLog)
885-
log.WithField("txHash", res.TxResponse.TxHash).WithError(err).Errorln("failed to broadcast messages batch")
883+
if err != nil {
884+
c.logger.WithError(err)
886885
} else {
887-
log.WithField("txHash", res.TxResponse.TxHash).Debugln("msg batch broadcasted successfully at height", res.TxResponse.Height)
886+
if res.TxResponse.Code != 0 {
887+
err = errors.Errorf("error %d (%s): %s", res.TxResponse.Code, res.TxResponse.Codespace, res.TxResponse.RawLog)
888+
c.logger.WithField("txHash", res.TxResponse.TxHash).WithError(err).Errorln("failed to broadcast messages batch")
889+
} else {
890+
c.logger.WithField("txHash", res.TxResponse.TxHash).Debugln("msg batch broadcasted successfully at height", res.TxResponse.Height)
891+
}
888892
}
889893

890-
log.Debugln("gas wanted: ", c.gasWanted)
894+
c.logger.Debugln("gas wanted: ", c.gasWanted)
891895
}
892896

893897
for {
@@ -2605,7 +2609,7 @@ func (c *chainClient) BroadcastMsg(broadcastMode txtypes.BroadcastMode, msgs ...
26052609
sequence := c.getAccSeq()
26062610
c.txFactory = c.txFactory.WithSequence(sequence)
26072611
c.txFactory = c.txFactory.WithAccountNumber(c.accNum)
2608-
log.Debugln("retrying broadcastTx with nonce", sequence)
2612+
c.logger.Debugln("retrying broadcastTx with nonce", sequence)
26092613
req, res, err = c.broadcastTx(c.ctx, c.txFactory, broadcastMode, msgs...)
26102614
}
26112615
if err != nil {

examples/chain/permissions/6_ClaimVoucher/example.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ package main
33
import (
44
"encoding/json"
55
"fmt"
6-
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
76
"os"
87

8+
rpchttp "github.com/cometbft/cometbft/rpc/client/http"
9+
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
10+
911
permissionstypes "github.com/InjectiveLabs/sdk-go/chain/permissions/types"
1012
"github.com/InjectiveLabs/sdk-go/client"
1113
chainclient "github.com/InjectiveLabs/sdk-go/client/chain"
1214
"github.com/InjectiveLabs/sdk-go/client/common"
13-
rpchttp "github.com/cometbft/cometbft/rpc/client/http"
1415
)
1516

1617
func main() {

0 commit comments

Comments
 (0)