<commit_before>package foundation

import (
	"errors"
	"os"

	"github.com/metacoin/flojson"
)

func RPCCall(command string, args ...interface{}) (interface{}, error) {
	// create a new command based on the command string given
	// handle errors, and return results to main function
	id := 1
	var cmd flojson.Cmd
	var err error
	var ret interface{}

	switch command {

	case "getblock":
		cmd, err = flojson.NewGetBlockCmd(id, args[0].(string))
	case "getblockhash":
		cmd, err = flojson.NewGetBlockHashCmd(id, args[0].(int))
	case "getblockcount":
		cmd, err = flojson.NewGetBlockCountCmd(id)
	case "getrawtransaction":
		cmd, err = flojson.NewGetRawTransactionCmd(id, args[0].(string))
	case "decoderawtransaction":
		cmd, err = flojson.NewDecodeRawTransactionCmd(id, args[0].(string))
	case "getnewaddress":
		cmd, err = flojson.NewGetNewAddressCmd(id)
	case "getconnectioncount":
		cmd, err = flojson.NewGetConnectionCountCmd(id)
	case "getnetworkhashps":
		cmd, err = flojson.NewGetNetworkHashPSCmd(id)
	case "settxfee":
		cmd, err = flojson.NewSetTxFeeCmd(id, args[0].(int64))
	case "sendtoaddress":
		cmd, err = flojson.NewSendToAddressCmd(id, args[0].(string), args[1].(int64), args[2], args[3], args[4])
	case "walletpassphrase":
		cmd, err = flojson.NewWalletPassphraseCmd(id, args[0].(string), args[1].(int))<commit_msg>added getmininginfo command<commit_after>package foundation

import (
	"errors"
	"os"

	"github.com/metacoin/flojson"
)

func RPCCall(command string, args ...interface{}) (interface{}, error) {
	// create a new command based on the command string given
	// handle errors, and return results to main function
	id := 1
	var cmd flojson.Cmd
	var err error
	var ret interface{}

	switch command {

	case "getblock":
		cmd, err = flojson.NewGetBlockCmd(id, args[0].(string))
	case "getblockhash":
		cmd, err = flojson.NewGetBlockHashCmd(id, args[0].(int))
	case "getblockcount":
		cmd, err = flojson.NewGetBlockCountCmd(id)
	case "getrawtransaction":
		cmd, err = flojson.NewGetRawTransactionCmd(id, args[0].(string))
	case "decoderawtransaction":
		cmd, err = flojson.NewDecodeRawTransactionCmd(id, args[0].(string))
	case "getnewaddress":
		cmd, err = flojson.NewGetNewAddressCmd(id)
	case "getmininginfo":
		cmd, err = flojson.NewGetMiningInfoCmd(id)
	case "getconnectioncount":
		cmd, err = flojson.NewGetConnectionCountCmd(id)
	case "getnetworkhashps":
		cmd, err = flojson.NewGetNetworkHashPSCmd(id)
	case "settxfee":
		cmd, err = flojson.NewSetTxFeeCmd(id, args[0].(int64))
	case "sendtoaddress":
		cmd, err = flojson.NewSendToAddressCmd(id, args[0].(string), args[1].(int64), args[2], args[3], args[4])
	case "walletpassphrase":
		cmd, err = flojson.NewWalletPassphraseCmd(id, args[0].(string), args[1].(int))
{'fraction_non_alphanumeric': 0.1415025528811087, 'fraction_numerical': 0.012399708242159009, 'mean_word_length': 5.423887587822014, 'pattern_counts': {'":': 23, '<': 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': '1400595', 'n_tokens_mistral': 1008, 'n_tokens_neox': 968, 'n_words': 228}