Skip to content

Commit

Permalink
transform skip errors into same format as squid err res for now. clea…
Browse files Browse the repository at this point in the history
…n up detekt erors
  • Loading branch information
yogurtandjam committed Jun 4, 2024
1 parent a499f76 commit 0c2b6c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import exchange.dydx.abacus.state.manager.CctpConfig.cctpChainIds
import exchange.dydx.abacus.utils.mutable
import exchange.dydx.abacus.utils.safeSet

@Suppress("NotImplementedDeclaration")

@Suppress("NotImplementedDeclaration", "ForbiddenComment")
internal class SkipProcessor(
parser: ParserProtocol,
private val internalState: InternalTransferInputState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import exchange.dydx.abacus.protocols.ParserProtocol
import exchange.dydx.abacus.utils.safeSet
import kotlin.math.pow

@Suppress("ForbiddenComment")
internal class SkipRouteProcessor(internal val parser: ParserProtocol) {
private val keyMap = mapOf(
"string" to mapOf(
Expand All @@ -23,7 +24,7 @@ internal class SkipRouteProcessor(internal val parser: ParserProtocol) {

private fun findFee(payload: Map<String, Any>, key: String): Double? {
val estimatedFees = parser.asList(parser.value(payload, "route.estimated_fees"))
val foundFeeObj = estimatedFees?.find { it ->
val foundFeeObj = estimatedFees?.find {
parser.asString(parser.asNativeMap(it)?.get("fee_type")) == key
}
val feeInUSD = parser.asDouble(parser.asNativeMap(foundFeeObj)?.get("usd_amount"))
Expand Down

0 comments on commit 0c2b6c3

Please sign in to comment.