diff --git a/x/interchainstaking/keeper/msg_server.go b/x/interchainstaking/keeper/msg_server.go index 8dd6912f1..180401a51 100644 --- a/x/interchainstaking/keeper/msg_server.go +++ b/x/interchainstaking/keeper/msg_server.go @@ -98,15 +98,15 @@ func (k msgServer) CancelRedemption(goCtx context.Context, msg *types.MsgCancelR // check for errored unbond in UNBONDING status record, found = k.GetWithdrawalRecord(ctx, msg.ChainId, msg.Hash, types.WithdrawStatusUnbond) if !found { - return nil, fmt.Errorf("no queued record with hash \"%s\" found", msg.Hash) + return nil, fmt.Errorf("no queued record with hash %q found", msg.Hash) } if record.SendErrors == 0 { - return nil, fmt.Errorf("cannot cancel unbond \"%s\" with no errors", msg.Hash) + return nil, fmt.Errorf("cannot cancel unbond %q with no errors", msg.Hash) } } if record.Delegator != msg.FromAddress && k.Keeper.GetGovAuthority(ctx) != msg.FromAddress { - return nil, fmt.Errorf("incorrect user for record with hash \"%s\"", msg.Hash) + return nil, fmt.Errorf("incorrect user for record with hash %q", msg.Hash) } // all good. delete! @@ -145,14 +145,14 @@ func (k msgServer) RequeueRedemption(goCtx context.Context, msg *types.MsgRequeu // check for errored unbond in UNBONDING status record, found := k.GetWithdrawalRecord(ctx, msg.ChainId, msg.Hash, types.WithdrawStatusUnbond) if !found { - return nil, fmt.Errorf("no unbonding record with hash \"%s\" found", msg.Hash) + return nil, fmt.Errorf("no unbonding record with hash %q found", msg.Hash) } if record.SendErrors == 0 { - return nil, fmt.Errorf("cannot requeue unbond \"%s\" with no errors", msg.Hash) + return nil, fmt.Errorf("cannot requeue unbond %q with no errors", msg.Hash) } if record.Delegator != msg.FromAddress && k.Keeper.GetGovAuthority(ctx) != msg.FromAddress { - return nil, fmt.Errorf("incorrect user for record with hash \"%s\"", msg.Hash) + return nil, fmt.Errorf("incorrect user for record with hash %q", msg.Hash) } // all good. update sendErrors to zero, nil the distributions and amount (as this we be recalculated when processed), and update the state to queued. @@ -208,7 +208,7 @@ func (k msgServer) UpdateRedemption(goCtx context.Context, msg *types.MsgUpdateR }) if r == nil { - return nil, fmt.Errorf("no unbonding record with hash \"%s\" found", msg.Hash) + return nil, fmt.Errorf("no unbonding record with hash %q found", msg.Hash) } if msg.NewStatus == types.WithdrawStatusQueued { @@ -244,7 +244,7 @@ func (k msgServer) SignalIntent(goCtx context.Context, msg *types.MsgSignalInten // get zone zone, ok := k.GetZone(ctx, msg.ChainId) if !ok { - return nil, fmt.Errorf("invalid chain id \"%s\"", msg.ChainId) + return nil, fmt.Errorf("invalid chain id %q", msg.ChainId) } // validate intents (aggregated errors) diff --git a/x/interchainstaking/keeper/msg_server_test.go b/x/interchainstaking/keeper/msg_server_test.go index e73cd65ae..7b0c3c97c 100644 --- a/x/interchainstaking/keeper/msg_server_test.go +++ b/x/interchainstaking/keeper/msg_server_test.go @@ -604,7 +604,7 @@ func (suite *KeeperTestSuite) TestGovReopenChannel() { Authority: "", } }, - expecErr: fmt.Errorf("unable to obtain chain id: invalid connection id, \"%s\" not found", ""), + expecErr: fmt.Errorf("unable to obtain chain id: invalid connection id, %q not found", ""), }, { name: "chainID / connectsionID mismatch", @@ -817,7 +817,7 @@ func (suite *KeeperTestSuite) TestMsgCancelRedemeption() { FromAddress: addressutils.GenerateAddressForTestWithPrefix("quick"), } }, - fmt.Sprintf("no queued record with hash \"%s\" found", hash), + fmt.Sprintf("no queued record with hash %q found", hash), }, { "no hash exists", @@ -828,7 +828,7 @@ func (suite *KeeperTestSuite) TestMsgCancelRedemeption() { FromAddress: addressutils.GenerateAddressForTestWithPrefix("quick"), } }, - fmt.Sprintf("no queued record with hash \"%s\" found", hash), + fmt.Sprintf("no queued record with hash %q found", hash), }, { "hash exists but in unbond status, no errors", @@ -851,7 +851,7 @@ func (suite *KeeperTestSuite) TestMsgCancelRedemeption() { FromAddress: address, } }, - fmt.Sprintf("cannot cancel unbond \"%s\" with no errors", hash), + fmt.Sprintf("cannot cancel unbond %q with no errors", hash), }, { "hash exists in queued status, with errors", @@ -903,7 +903,7 @@ func (suite *KeeperTestSuite) TestMsgCancelRedemeption() { FromAddress: address, } }, - fmt.Sprintf("incorrect user for record with hash \"%s\"", hash), + fmt.Sprintf("incorrect user for record with hash %q", hash), }, { "valid", @@ -1002,7 +1002,7 @@ func (suite *KeeperTestSuite) TestMsgRequeueRedemeption() { FromAddress: addressutils.GenerateAddressForTestWithPrefix("quick"), } }, - fmt.Sprintf("no unbonding record with hash \"%s\" found", hash), + fmt.Sprintf("no unbonding record with hash %q found", hash), }, { "no hash exists", @@ -1013,7 +1013,7 @@ func (suite *KeeperTestSuite) TestMsgRequeueRedemeption() { FromAddress: addressutils.GenerateAddressForTestWithPrefix("quick"), } }, - fmt.Sprintf("no unbonding record with hash \"%s\" found", hash), + fmt.Sprintf("no unbonding record with hash %q found", hash), }, { "hash exists but in unbond status, no errors", @@ -1036,7 +1036,7 @@ func (suite *KeeperTestSuite) TestMsgRequeueRedemeption() { FromAddress: address, } }, - fmt.Sprintf("cannot requeue unbond \"%s\" with no errors", hash), + fmt.Sprintf("cannot requeue unbond %q with no errors", hash), }, { "hash exists in queued status, with errors", @@ -1086,7 +1086,7 @@ func (suite *KeeperTestSuite) TestMsgRequeueRedemeption() { FromAddress: address, } }, - fmt.Sprintf("incorrect user for record with hash \"%s\"", hash), + fmt.Sprintf("incorrect user for record with hash %q", hash), }, { "valid - governance", @@ -1161,7 +1161,7 @@ func (suite *KeeperTestSuite) TestMsgUpdateRedemption() { FromAddress: k.GetGovAuthority(ctx), } }, - fmt.Sprintf("no unbonding record with hash \"%s\" found", hash), + fmt.Sprintf("no unbonding record with hash %q found", hash), nil, }, { @@ -1176,7 +1176,7 @@ func (suite *KeeperTestSuite) TestMsgUpdateRedemption() { FromAddress: k.GetGovAuthority(ctx), } }, - fmt.Sprintf("no unbonding record with hash \"%s\" found", hash), + fmt.Sprintf("no unbonding record with hash %q found", hash), nil, }, { diff --git a/x/interchainstaking/keeper/proposal_handler.go b/x/interchainstaking/keeper/proposal_handler.go index 3af560170..df943e25b 100644 --- a/x/interchainstaking/keeper/proposal_handler.go +++ b/x/interchainstaking/keeper/proposal_handler.go @@ -30,7 +30,7 @@ func (k *Keeper) HandleRegisterZoneProposal(ctx sdk.Context, p *types.RegisterZo // get zone _, found := k.GetZone(ctx, chainID) if found { - return fmt.Errorf("invalid chain id, zone for \"%s\" already registered", chainID) + return fmt.Errorf("invalid chain id, zone for %q already registered", chainID) } connection, found := k.IBCKeeper.ConnectionKeeper.GetConnection(ctx, p.ConnectionId) diff --git a/x/participationrewards/keeper/msg_server.go b/x/participationrewards/keeper/msg_server.go index 16d3e4194..1244d9175 100644 --- a/x/participationrewards/keeper/msg_server.go +++ b/x/participationrewards/keeper/msg_server.go @@ -36,7 +36,7 @@ func (k msgServer) SubmitClaim(goCtx context.Context, msg *types.MsgSubmitClaim) // fetch zone zone, ok := k.icsKeeper.GetZone(ctx, msg.Zone) if !ok { - return nil, fmt.Errorf("invalid zone, chain id \"%s\" not found", msg.Zone) + return nil, fmt.Errorf("invalid zone, chain id %q not found", msg.Zone) } var pd types.ProtocolData pd, ok = k.GetProtocolData(ctx, types.ProtocolDataTypeConnection, msg.SrcZone)