Skip to content

Commit

Permalink
chore: remove fmt.Sprintf()
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Oct 4, 2023
1 parent 6216001 commit 50a11b6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/loadtest/uniswapv3.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,24 +474,24 @@ func deployOrInstantiateContract[T uniswapV3Contract](
// Deploy the contract if known address is empty.
address, _, contract, err = deployFunc(tops, c)
if err != nil {
log.Error().Err(err).Msg(fmt.Sprintf("Unable to deploy %s contract", name))
log.Error().Err(err).Str("name", name).Msg("Unable to deploy contract")
return
}
log.Debug().Interface("address", address).Msg(fmt.Sprintf("%s contract deployed", name))
log.Debug().Str("name", name).Interface("address", address).Msg("contract deployed")
} else {
// Otherwise, instantiate the contract.
address = knownAddress
contract, err = instantiateFunc(address, c)
if err != nil {
log.Error().Err(err).Msg(fmt.Sprintf("Unable to instantiate %s contract", name))
log.Error().Err(err).Str("name", name).Msg("Unable to instantiate contract")
return
}
log.Debug().Msg(fmt.Sprintf("%s contract instantiated", name))
log.Debug().Str("name", name).Msg("contract instantiated")
}

// Check that the contract is deployed and ready.
if err = blockUntilSuccessful(ctx, c, func() error {
log.Trace().Msg(fmt.Sprintf("%s contract is not available yet", name))
log.Trace().Str("contract", name).Msg("contract is not available yet")
return callFunc(contract)
}); err != nil {
return
Expand Down Expand Up @@ -584,7 +584,7 @@ func approveSwapperSpendingsByUniswap(contract *uniswapv3.Swapper, tops *bind.Tr
for _, address := range addresses {
_, err := contract.Approve(tops, address, amount)
if err != nil {
log.Error().Err(err).Msg(fmt.Sprintf("Unable to approve %v spendings", address))
log.Error().Err(err).Interface("address", address).Msg("Unable to approve spendings")
return err
}
log.Debug().Str("Swapper", name).Str("spender", address.String()).Int64("amount", amount.Int64()).Msg("Spending approved")
Expand Down

0 comments on commit 50a11b6

Please sign in to comment.