Exemplo n.º 1
0
 /**
  * All exchanges, even those that are disabled, should have a definition through
  * {@link #get_accounts_wizard_config_basic()}.
  */
 function testAllAccountsHaveWizardConfig()
 {
     $account_data_grouped = account_data_grouped();
     foreach (array('Mining pools', 'Exchanges', 'Securities') as $group_key) {
         foreach ($account_data_grouped[$group_key] as $key => $data) {
             $this->assertNotNull(get_accounts_wizard_config_basic($key), "Expected a wizard config for exchange '{$key}'");
         }
     }
 }
Exemplo n.º 2
0
function get_accounts_wizard_config($exchange)
{
    $result = get_accounts_wizard_config_basic($exchange);
    if (!isset($result['title'])) {
        $result['title'] = get_exchange_name($exchange) . " account";
    }
    if (!isset($result['titles'])) {
        $result['titles'] = $result['title'] . "s";
    }
    if (!isset($result['khash'])) {
        $result['khash'] = false;
    }
    if (!isset($result['interaction'])) {
        $result['interaction'] = false;
    }
    if (!isset($result['fixed_inputs'])) {
        $result['fixed_inputs'] = array();
    }
    foreach ($result['inputs'] as $key => $data) {
        $result['inputs'][$key]['key'] = $key;
        if (!isset($result['inputs'][$key]['inline_title'])) {
            $result['inputs'][$key]['inline_title'] = $result['inputs'][$key]['title'];
        }
    }
    foreach (account_data_grouped() as $group => $data) {
        foreach ($data as $key => $values) {
            if ($key == $exchange && isset($values['wizard'])) {
                $result['wizard'] = $values['wizard'];
            }
        }
    }
    $result['exchange'] = $exchange;
    return $result;
}