<commit_before>package foundation.omni.rest.omniwallet

import static foundation.omni.CurrencyID.*
import foundation.omni.net.OmniMainNetParams
import org.bitcoinj.core.Address
import spock.lang.Specification


/**
 *
 */
class OmniwalletClientSpec extends Specification {
    final Address exodusAddress = OmniMainNetParams.get().exodusAddress;
    final Address testAddr = new Address(null, "19ZbcHED8F6u5Wr5gp97KMVNvKV8HUrmeu")

    def "load testAddr balance"() {
        given:
        def client = new OmniwalletClient()

        when:
        def balances = client.balancesForAddress(testAddr)

        then:
        balances != null
        balances[0].symbol == "SP31"
        balances[0].id == USDT
        balances[0].value >= 0
        balances[1].symbol == "BTC"
        balances[1].id == BTC
        balances[1].value.numberValue() >= 0
    }

    def "load exodusAddress balance"() {
        given:
        def client = new OmniwalletClient()

        when:
        def balances = client.balancesForAddress(exodusAddress)

        then:
        balances != null
        balances[0].symbol == "MSC"
        balances[0].id == MSC
        balances[0].value.numberValue() >= 0
        balances[1].symbol == "TMSC"
        balances[1].id == TMSC
        balances[1].value.numberValue() >= 0
        balances[2].symbol == "BTC"
        balances[2].id == BTC
        balances[2].value.numberValue() >= 0
    }

    def "load balances of addresses with single address"() {
        given:
        def client = new OmniwalletClient()<commit_msg>Change order of currencies in expected result.<commit_after>package foundation.omni.rest.omniwallet

import static foundation.omni.CurrencyID.*
import foundation.omni.net.OmniMainNetParams
import org.bitcoinj.core.Address
import spock.lang.Specification


/**
 *
 */
class OmniwalletClientSpec extends Specification {
    final Address exodusAddress = OmniMainNetParams.get().exodusAddress;
    final Address testAddr = new Address(null, "19ZbcHED8F6u5Wr5gp97KMVNvKV8HUrmeu")

    def "load testAddr balance"() {
        given:
        def client = new OmniwalletClient()

        when:
        def balances = client.balancesForAddress(testAddr)

        then:
        balances != null
        balances[0].symbol == "SP31"
        balances[0].id == USDT
        balances[0].value >= 0
        balances[1].symbol == "BTC"
        balances[1].id == BTC
        balances[1].value.numberValue() >= 0
    }

    def "load exodusAddress balance"() {
        given:
        def client = new OmniwalletClient()

        when:
        def balances = client.balancesForAddress(exodusAddress)

        then:
        balances != null
        balances[0].symbol == "BTC"
        balances[0].id == BTC
        balances[0].value.numberValue() >= 0
        balances[1].symbol == "MSC"
        balances[1].id == MSC
        balances[1].value.numberValue() >= 0
        balances[2].symbol == "TMSC"
        balances[2].id == TMSC
        balances[2].value.numberValue() >= 0
    }

    def "load balances of addresses with single address"() {
        given:
        def client = new OmniwalletClient()
{'fraction_non_alphanumeric': 0.11458665815512288, 'fraction_numerical': 0.01978933929141398, 'mean_word_length': 2.505592841163311, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5400859', 'n_tokens_mistral': 1009, 'n_tokens_neox': 960, 'n_words': 205}