Skip to content

Commit

Permalink
address detekt complaint about noble denom
Browse files Browse the repository at this point in the history
  • Loading branch information
yogurtandjam committed Jun 19, 2024
1 parent 3b0189b commit 78b08bb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ class V4StateManagerConfigs(
return "$skipHost/v2/fungible/msgs_direct"
}

fun nobleDenom(): String {
return "uusdc"
}
val nobleDenom = "uusdc"

private val skipHost: String
get() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ internal open class AccountSupervisor(
private fun transferNobleBalanceSquid(amount: BigDecimal) {
val url = helper.configs.squidRoute()
val fromChain = helper.configs.nobleChainId()
val fromToken = helper.configs.nobleDenom()
val fromToken = helper.configs.nobleDenom
val nobleAddress = accountAddress.toNobleAddress()
val chainId = helper.environment.dydxChainId
val squidIntegratorId = helper.environment.squidIntegratorId
Expand Down Expand Up @@ -658,7 +658,7 @@ internal open class AccountSupervisor(
private fun transferNobleBalanceSkip(amount: BigDecimal) {
val url = helper.configs.skipV2MsgsDirect()
val fromChain = helper.configs.nobleChainId()
val fromToken = helper.configs.nobleDenom()
val fromToken = helper.configs.nobleDenom
val nobleAddress = accountAddress.toNobleAddress() ?: return
val chainId = helper.environment.dydxChainId ?: return
val dydxTokenDemon = helper.environment.tokens["usdc"]?.denom ?: return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ internal class OnboardingSupervisor(
val nobleAddress = accountAddress.toNobleAddress()
val url = helper.configs.skipV2MsgsDirect()
val toChain = helper.configs.nobleChainId()
val toToken = helper.configs.nobleDenom()
val toToken = helper.configs.nobleDenom
if (fromChain != null &&
fromToken != null &&
fromAmount != null && fromAmount > 0 &&
Expand Down Expand Up @@ -428,7 +428,7 @@ internal class OnboardingSupervisor(
val nobleAddress = accountAddress.toNobleAddress()
val url = helper.configs.squidV2Route()
val toChain = helper.configs.nobleChainId()
val toToken = helper.configs.nobleDenom()
val toToken = helper.configs.nobleDenom
if (fromChain != null &&
fromToken != null &&
fromAmount != null && fromAmount > 0 &&
Expand Down Expand Up @@ -751,7 +751,7 @@ internal class OnboardingSupervisor(
subaccountNumber: Int?,
) {
val nobleChain = helper.configs.nobleChainId()
val nobleToken = helper.configs.nobleDenom()
val nobleToken = helper.configs.nobleDenom
val toAddress = state?.input?.transfer?.address
val usdcSize = helper.parser.asDecimal(state?.input?.transfer?.size?.usdcSize)
val fromAmount = if (usdcSize != null && usdcSize > gas) {
Expand Down Expand Up @@ -885,7 +885,7 @@ internal class OnboardingSupervisor(
val url = helper.configs.squidV2Route()
val fromAddress = accountAddress.toNobleAddress()
val fromChain = helper.configs.nobleChainId()
val fromToken = helper.configs.nobleDenom()
val fromToken = helper.configs.nobleDenom
if (toChain != null &&
toToken != null &&
toAddress != null &&
Expand Down Expand Up @@ -946,7 +946,7 @@ internal class OnboardingSupervisor(
subaccountNumber: Int?,
) {
val toChain = helper.configs.nobleChainId() ?: return
val toToken = helper.configs.nobleDenom() ?: return
val toToken = helper.configs.nobleDenom ?: return
val toAddress = state?.input?.transfer?.address ?: return
val usdcSize = helper.parser.asDecimal(state?.input?.transfer?.size?.usdcSize) ?: return
val fromAmount = if (usdcSize > gas) {
Expand Down Expand Up @@ -1055,7 +1055,7 @@ internal class OnboardingSupervisor(
val fromAddress = accountAddress.toNobleAddress() ?: return

val fromChain = helper.configs.nobleChainId() ?: return
val fromToken = helper.configs.nobleDenom() ?: return
val fromToken = helper.configs.nobleDenom ?: return
val body: Map<String, Any> = mapOf(
"amount_in" to fromAmountString,
"source_asset_denom" to fromToken,
Expand Down Expand Up @@ -1129,7 +1129,7 @@ internal class OnboardingSupervisor(
private fun transferNobleBalance(accountAddress: String, amount: BigDecimal) {
val url = helper.configs.squidRoute()
val fromChain = helper.configs.nobleChainId()
val fromToken = helper.configs.nobleDenom()
val fromToken = helper.configs.nobleDenom
val nobleAddress = accountAddress.toNobleAddress()
val chainId = helper.environment.dydxChainId
val squidIntegratorId = helper.environment.squidIntegratorId
Expand Down Expand Up @@ -1382,7 +1382,7 @@ internal class OnboardingSupervisor(
) {
val url = helper.configs.squidRoute()
val nobleChain = helper.configs.nobleChainId()
val nobleToken = helper.configs.nobleDenom()
val nobleToken = helper.configs.nobleDenom
val nobleAddress = accountAddress.toNobleAddress()
val chainId = helper.environment.dydxChainId
val squidIntegratorId = helper.environment.squidIntegratorId
Expand Down Expand Up @@ -1490,7 +1490,7 @@ internal class OnboardingSupervisor(
// DO-LATER: https://linear.app/dydx/issue/OTE-350/%5Babacus%5D-cleanup
val url = helper.configs.skipV2MsgsDirect()
val nobleChain = helper.configs.nobleChainId()
val nobleToken = helper.configs.nobleDenom()
val nobleToken = helper.configs.nobleDenom
val nobleAddress = accountAddress.toNobleAddress()
val chainId = helper.environment.dydxChainId
val nativeChainUSDCDenom = helper.environment.tokens["usdc"]?.denom
Expand Down

0 comments on commit 78b08bb

Please sign in to comment.