Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.

Commit

Permalink
fix token definitions json to resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Stavetski committed Apr 14, 2018
1 parent cadc3a7 commit 01be6eb
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import io.micrometer.core.instrument.Tags
import io.micrometer.core.instrument.Timer
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.core.io.ClassPathResource
import org.springframework.context.support.GenericApplicationContext
import org.springframework.kafka.core.KafkaTemplate
import org.springframework.stereotype.Component
import org.web3j.protocol.Web3j
Expand Down Expand Up @@ -60,6 +60,9 @@ class EtherdeltaConnector : ExchangeConnector {
private lateinit var parityTokenRegistryContract: ParityTokenRegistryContract
private lateinit var etherdeltaContract: EtherdeltaContract

@Autowired
private lateinit var resourceLoader: GenericApplicationContext

@Autowired
private lateinit var configuration: ConnectorConfiguration

Expand Down Expand Up @@ -223,10 +226,10 @@ class EtherdeltaConnector : ExchangeConnector {
override fun updateTokensPairs() {
log.info("Updating tokens pairs")

val parityTokenRegistryTokens = getParityTokenRegistryTokens()
//val parityTokenRegistryTokens = getParityTokenRegistryTokens()
val etherdeltaConfigTokens = getEtherdeltaConfigTokens()
val myEtherWalletTokens = getMyEtherWalletTokens()
exchangeTokensPairs = parityTokenRegistryTokens
exchangeTokensPairs = etherdeltaConfigTokens
exchangeTokensPairs.putAll(etherdeltaConfigTokens)
exchangeTokensPairs.putAll(myEtherWalletTokens)

Expand Down Expand Up @@ -267,7 +270,8 @@ class EtherdeltaConnector : ExchangeConnector {
val tokens = mutableMapOf<String, EtherdeltaToken>()
val base = BigInteger.TEN

val tokenListTree = mapper.readValue<Iterable<JsonNode>>(ClassPathResource("tokens-eth.json").file)
val tokenDefinition = resourceLoader.getResource("classpath:tokens-eth.json").file
val tokenListTree = mapper.readValue<Iterable<JsonNode>>(tokenDefinition)
tokenListTree.asIterable().forEach { tokenNode ->

if (tokenNode.get("decimals").asInt() != 0) {
Expand Down

0 comments on commit 01be6eb

Please sign in to comment.