<commit_before>// Copyright 2016 Factom Foundation
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.

package factom

import (
	"fmt"
	
	netki "github.com/FactomProject/netki-go-partner-client"
)

func ResolveDnsName(addr string) (string, string, error) {
	fct, ferr := netki.WalletNameLookup(addr, "fct")
	ec, eerr := netki.WalletNameLookup(addr, "fec")
	if ferr != nil && eerr != nil {
		return fct, ec, fmt.Errorf("%s\n%s", ferr, eerr)
	}
	return fct, ec, nil
}

func GetDnsBalance(addr string) (int64, int64, error) {
	fct, ec, err := ResolveDnsName(addr)
	if err != nil {
		return -1, -1, err
	}

	f, err1 := GetFactoidBalance(fct)
	e, err2 := GetECBalance(ec)
	if err1 != nil || err2 != nil {
		return f, e, fmt.Errorf("%s\n%s\n", err1, err2)
	}

	return f, e, nil
}<commit_msg>minor cleanup<commit_after>// Copyright 2016 Factom Foundation
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.

package factom

import (
	"fmt"
	
	netki "github.com/FactomProject/netki-go-partner-client"
)

func ResolveDnsName(addr string) (string, string, error) {
	fct, err1 := netki.WalletNameLookup(addr, "fct")
	ec, err2 := netki.WalletNameLookup(addr, "fec")
	if err1 != nil && err2 != nil {
		return fct, ec, fmt.Errorf("%s\n%s", err1, err2)
	}
	return fct, ec, nil
}

func GetDnsBalance(addr string) (int64, int64, error) {
	fct, ec, err := ResolveDnsName(addr)
	if err != nil {
		return -1, -1, err
	}

	f, err1 := GetFactoidBalance(fct)
	e, err2 := GetECBalance(ec)
	if err1 != nil || err2 != nil {
		return f, e, fmt.Errorf("%s\n%s\n", err1, err2)
	}

	return f, e, nil
}
{'fraction_non_alphanumeric': 0.1498800959232614, 'fraction_numerical': 0.022781774580335732, 'mean_word_length': 3.795977011494253, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6661476', 'n_tokens_mistral': 683, 'n_tokens_neox': 662, 'n_words': 195}