change currency three-letter-code to DOGE

also change length of currency amounts in UI

(cherry picked from commit inutoshi/inutoshi@8dcef8791a)
This commit is contained in:
Jannis Froese 2014-03-24 05:00:24 +01:00
parent bdee9dc992
commit 9cae5ebbaf
13 changed files with 68 additions and 68 deletions

View file

@ -40,7 +40,7 @@
* - code = 4 (vout[1] is not spent, and 0 non-zero bytes of bitvector follow)
* - unspentness bitvector: as 0 non-zero bytes follow, it has length 0
* - vout[1]: 835800816115944e077fe7c803cfa57f29b36bf87c1d35
* * 8358: compact amount representation for 60000000000 (600 BTC)
* * 8358: compact amount representation for 60000000000 (600 DOGE)
* * 00: special txout type pay-to-pubkey-hash
* * 816115944e077fe7c803cfa57f29b36bf87c1d35: address uint160
* - height = 203998
@ -56,11 +56,11 @@
* 2 (1, +1 because both bit 2 and bit 4 are unset) non-zero bitvector bytes follow)
* - unspentness bitvector: bits 2 (0x04) and 14 (0x4000) are set, so vout[2+2] and vout[14+2] are unspent
* - vout[4]: 86ef97d5790061b01caab50f1b8e9c50a5057eb43c2d9563a4ee
* * 86ef97d579: compact amount representation for 234925952 (2.35 BTC)
* * 86ef97d579: compact amount representation for 234925952 (2.35 DOGE)
* * 00: special txout type pay-to-pubkey-hash
* * 61b01caab50f1b8e9c50a5057eb43c2d9563a4ee: address uint160
* - vout[16]: bbd123008c988f1a4a4de2161e0f50aac7f17e7f9555caa4
* * bbd123: compact amount representation for 110397 (0.001 BTC)
* * bbd123: compact amount representation for 110397 (0.001 DOGE)
* * 00: special txout type pay-to-pubkey-hash
* * 8c988f1a4a4de2161e0f50aac7f17e7f9555caa4: address uint160
* - height = 120891

View file

@ -15,9 +15,9 @@ BitcoinUnits::BitcoinUnits(QObject *parent):
QList<BitcoinUnits::Unit> BitcoinUnits::availableUnits()
{
QList<BitcoinUnits::Unit> unitlist;
unitlist.append(BTC);
unitlist.append(mBTC);
unitlist.append(uBTC);
unitlist.append(DOGE);
unitlist.append(mDOGE);
unitlist.append(uDOGE);
return unitlist;
}
@ -25,9 +25,9 @@ bool BitcoinUnits::valid(int unit)
{
switch(unit)
{
case BTC:
case mBTC:
case uBTC:
case DOGE:
case mDOGE:
case uDOGE:
return true;
default:
return false;
@ -38,9 +38,9 @@ QString BitcoinUnits::name(int unit)
{
switch(unit)
{
case BTC: return QString("BTC");
case mBTC: return QString("mBTC");
case uBTC: return QString::fromUtf8("μBTC");
case DOGE: return QString("DOGE");
case mDOGE: return QString("mDOGE");
case uDOGE: return QString::fromUtf8("μDOGE");
default: return QString("???");
}
}
@ -49,9 +49,9 @@ QString BitcoinUnits::description(int unit)
{
switch(unit)
{
case BTC: return QString("Bitcoins");
case mBTC: return QString("Milli-Bitcoins (1 / 1,000)");
case uBTC: return QString("Micro-Bitcoins (1 / 1,000,000)");
case DOGE: return QString("Dogecoin");
case mDOGE: return QString("Milli-Dogecoin (1 / 1,000)");
case uDOGE: return QString("Micro-Dogecoin (1 / 1,000,000)");
default: return QString("???");
}
}
@ -60,9 +60,9 @@ qint64 BitcoinUnits::factor(int unit)
{
switch(unit)
{
case BTC: return 100000000;
case mBTC: return 100000;
case uBTC: return 100;
case DOGE: return 100000000;
case mDOGE: return 100000;
case uDOGE: return 100;
default: return 100000000;
}
}
@ -71,9 +71,9 @@ qint64 BitcoinUnits::maxAmount(int unit)
{
switch(unit)
{
case BTC: return Q_INT64_C(21000000);
case mBTC: return Q_INT64_C(21000000000);
case uBTC: return Q_INT64_C(21000000000000);
case DOGE: return Q_INT64_C(900000000000); //less than the coin supply until the year 2170
case mDOGE: return Q_INT64_C(900000000000000);
case uDOGE: return Q_INT64_C(900000000000000000);
default: return 0;
}
}
@ -82,9 +82,9 @@ int BitcoinUnits::amountDigits(int unit)
{
switch(unit)
{
case BTC: return 8; // 21,000,000 (# digits, without commas)
case mBTC: return 11; // 21,000,000,000
case uBTC: return 14; // 21,000,000,000,000
case DOGE: return 12; // 900,000,000,000 (# digits, without commas)
case mDOGE: return 15; // 900,000,000,000,000
case uDOGE: return 18; // 900,000,000,000,000,000
default: return 0;
}
}
@ -93,9 +93,9 @@ int BitcoinUnits::decimals(int unit)
{
switch(unit)
{
case BTC: return 8;
case mBTC: return 5;
case uBTC: return 2;
case DOGE: return 8;
case mDOGE: return 5;
case uDOGE: return 2;
default: return 0;
}
}

View file

@ -23,9 +23,9 @@ public:
*/
enum Unit
{
BTC,
mBTC,
uBTC
DOGE,
mDOGE,
uDOGE
};
//! @name Static API

View file

@ -561,7 +561,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
}
// actually update labels
int nDisplayUnit = BitcoinUnits::BTC;
int nDisplayUnit = BitcoinUnits::DOGE;
if (model && model->getOptionsModel())
nDisplayUnit = model->getOptionsModel()->getDisplayUnit();
@ -594,7 +594,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
l5->setStyleSheet((nBytes >= 1000) ? "color:red;" : ""); // Bytes >= 1000
l6->setStyleSheet((dPriority > 0 && !AllowFree(dPriority)) ? "color:red;" : ""); // Priority < "medium"
l7->setStyleSheet((fLowOutput) ? "color:red;" : ""); // Low Output = "yes"
l8->setStyleSheet((nChange > 0 && nChange < CENT) ? "color:red;" : ""); // Change < 0.01BTC
l8->setStyleSheet((nChange > 0 && nChange < CENT) ? "color:red;" : ""); // Change < 0.01DOGE
// tool tips
QString toolTip1 = tr("This label turns red, if the transaction size is greater than 1000 bytes.") + "<br /><br />";
@ -637,7 +637,7 @@ void CoinControlDialog::updateView()
QFlags<Qt::ItemFlag> flgCheckbox=Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
QFlags<Qt::ItemFlag> flgTristate=Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate;
int nDisplayUnit = BitcoinUnits::BTC;
int nDisplayUnit = BitcoinUnits::DOGE;
if (model && model->getOptionsModel())
nDisplayUnit = model->getOptionsModel()->getDisplayUnit();

View file

@ -133,7 +133,7 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
{
if(!i->second.isEmpty())
{
if(!BitcoinUnits::parse(BitcoinUnits::BTC, i->second, &rv.amount))
if(!BitcoinUnits::parse(BitcoinUnits::DOGE, i->second, &rv.amount))
{
return false;
}
@ -172,7 +172,7 @@ QString formatBitcoinURI(const SendCoinsRecipient &info)
if (info.amount)
{
ret += QString("?amount=%1").arg(BitcoinUnits::format(BitcoinUnits::BTC, info.amount));
ret += QString("?amount=%1").arg(BitcoinUnits::format(BitcoinUnits::DOGE, info.amount));
paramCount++;
}

View file

@ -135,7 +135,7 @@ void OptionsDialog::setModel(OptionsModel *model)
mapper->toFirst();
}
/* update the display unit, to not use the default ("BTC") */
/* update the display unit, to not use the default ("DOGE") */
updateDisplayUnit();
/* warn when one of the following settings changes by user action (placed here so init via mapper doesn't trigger them) */

View file

@ -51,7 +51,7 @@ void OptionsModel::Init()
// Display
if (!settings.contains("nDisplayUnit"))
settings.setValue("nDisplayUnit", BitcoinUnits::BTC);
settings.setValue("nDisplayUnit", BitcoinUnits::DOGE);
nDisplayUnit = settings.value("nDisplayUnit").toInt();
if (!settings.contains("bDisplayAddresses"))

View file

@ -24,7 +24,7 @@ class TxViewDelegate : public QAbstractItemDelegate
{
Q_OBJECT
public:
TxViewDelegate(): QAbstractItemDelegate(), unit(BitcoinUnits::BTC)
TxViewDelegate(): QAbstractItemDelegate(), unit(BitcoinUnits::DOGE)
{
}
@ -188,7 +188,7 @@ void OverviewPage::setWalletModel(WalletModel *model)
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
}
// update the display unit, to not use the default ("BTC")
// update the display unit, to not use the default ("DOGE")
updateDisplayUnit();
}

View file

@ -98,7 +98,7 @@ void SendCoinsEntry::clear()
ui->memoTextLabel_s->clear();
ui->payAmount_s->clear();
// update the display unit, to not use the default ("BTC")
// update the display unit, to not use the default ("DOGE")
updateDisplayUnit();
}

View file

@ -339,7 +339,7 @@ Value gettxout(const Array& params, bool fHelp)
"{\n"
" \"bestblock\" : \"hash\", (string) the block hash\n"
" \"confirmations\" : n, (numeric) The number of confirmations\n"
" \"value\" : x.xxx, (numeric) The transaction value in btc\n"
" \"value\" : x.xxx, (numeric) The transaction value in doge\n"
" \"scriptPubKey\" : { (json object)\n"
" \"asm\" : \"code\", (string) \n"
" \"hex\" : \"hex\", (string) \n"

View file

@ -46,7 +46,7 @@ Value getinfo(const Array& params, bool fHelp)
" \"testnet\": true|false, (boolean) if the server is using testnet or not\n"
" \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool\n"
" \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n"
" \"paytxfee\": x.xxxx, (numeric) the transaction fee set in btc\n"
" \"paytxfee\": x.xxxx, (numeric) the transaction fee set in doge\n"
" \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n"
" \"errors\": \"...\" (string) any error messages\n"
"}\n"

View file

@ -144,7 +144,7 @@ Value getrawtransaction(const Array& params, bool fHelp)
" ],\n"
" \"vout\" : [ (array of json objects)\n"
" {\n"
" \"value\" : x.xxx, (numeric) The value in btc\n"
" \"value\" : x.xxx, (numeric) The value in doge\n"
" \"n\" : n, (numeric) index\n"
" \"scriptPubKey\" : { (json object)\n"
" \"asm\" : \"asm\", (string) the asm\n"
@ -222,7 +222,7 @@ Value listunspent(const Array& params, bool fHelp)
" \"address\" : \"address\", (string) the bitcoin address\n"
" \"account\" : \"account\", (string) The associated account, or \"\" for the default account\n"
" \"scriptPubKey\" : \"key\", (string) the script key\n"
" \"amount\" : x.xxx, (numeric) the transaction amount in btc\n"
" \"amount\" : x.xxx, (numeric) the transaction amount in doge\n"
" \"confirmations\" : n (numeric) The number of confirmations\n"
" }\n"
" ,...\n"
@ -332,7 +332,7 @@ Value createrawtransaction(const Array& params, bool fHelp)
" ]\n"
"2. \"addresses\" (string, required) a json object with addresses as keys and amounts as values\n"
" {\n"
" \"address\": x.xxx (numeric, required) The key is the bitcoin address, the value is the btc amount\n"
" \"address\": x.xxx (numeric, required) The key is the bitcoin address, the value is the doge amount\n"
" ,...\n"
" }\n"
@ -422,7 +422,7 @@ Value decoderawtransaction(const Array& params, bool fHelp)
" ],\n"
" \"vout\" : [ (array of json objects)\n"
" {\n"
" \"value\" : x.xxx, (numeric) The value in btc\n"
" \"value\" : x.xxx, (numeric) The value in doge\n"
" \"n\" : n, (numeric) index\n"
" \"scriptPubKey\" : { (json object)\n"
" \"asm\" : \"asm\", (string) the asm\n"

View file

@ -311,7 +311,7 @@ Value sendtoaddress(const Array& params, bool fHelp)
+ HelpRequiringPassphrase() +
"\nArguments:\n"
"1. \"bitcoinaddress\" (string, required) The bitcoin address to send to.\n"
"2. \"amount\" (numeric, required) The amount in btc to send. eg 0.1\n"
"2. \"amount\" (numeric, required) The amount in doge to send. eg 100.01\n"
"3. \"comment\" (string, optional) A comment used to store what the transaction is for. \n"
" This is not part of the transaction, just kept in your wallet.\n"
"4. \"comment-to\" (string, optional) A comment to store the name of the person or organization \n"
@ -361,7 +361,7 @@ Value listaddressgroupings(const Array& params, bool fHelp)
" [\n"
" [\n"
" \"bitcoinaddress\", (string) The bitcoin address\n"
" amount, (numeric) The amount in btc\n"
" amount, (numeric) The amount in doge\n"
" \"account\" (string, optional) The account\n"
" ]\n"
" ,...\n"
@ -456,7 +456,7 @@ Value getreceivedbyaddress(const Array& params, bool fHelp)
"1. \"bitcoinaddress\" (string, required) The bitcoin address for transactions.\n"
"2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n"
"\nResult:\n"
"amount (numeric) The total amount in btc received at this address.\n"
"amount (numeric) The total amount in doge received at this address.\n"
"\nExamples:\n"
"\nThe amount from transactions with at least 1 confirmation\n"
+ HelpExampleCli("getreceivedbyaddress", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\"") +
@ -510,7 +510,7 @@ Value getreceivedbyaccount(const Array& params, bool fHelp)
"1. \"account\" (string, required) The selected account, may be the default account using \"\".\n"
"2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n"
"\nResult:\n"
"amount (numeric) The total amount in btc received for this account.\n"
"amount (numeric) The total amount in doge received for this account.\n"
"\nExamples:\n"
"\nAmount received by the default account with at least 1 confirmation\n"
+ HelpExampleCli("getreceivedbyaccount", "\"\"") +
@ -597,7 +597,7 @@ Value getbalance(const Array& params, bool fHelp)
"1. \"account\" (string, optional) The selected account, or \"*\" for entire wallet. It may be the default account using \"\".\n"
"2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n"
"\nResult:\n"
"amount (numeric) The total amount in btc received for this account.\n"
"amount (numeric) The total amount in doge received for this account.\n"
"\nExamples:\n"
"\nThe total amount in the server across all accounts\n"
+ HelpExampleCli("getbalance", "") +
@ -677,9 +677,9 @@ Value movecmd(const Array& params, bool fHelp)
"\nResult:\n"
"true|false (boolean) true if successfull.\n"
"\nExamples:\n"
"\nMove 0.01 btc from the default account to the account named tabby\n"
"\nMove 0.01 doge from the default account to the account named tabby\n"
+ HelpExampleCli("move", "\"\" \"tabby\" 0.01") +
"\nMove 0.01 btc timotei to akiko with a comment and funds have 6 confirmations\n"
"\nMove 0.01 doge timotei to akiko with a comment and funds have 6 confirmations\n"
+ HelpExampleCli("move", "\"timotei\" \"akiko\" 0.01 6 \"happy birthday!\"") +
"\nAs a json rpc call\n"
+ HelpExampleRpc("move", "\"timotei\", \"akiko\", 0.01, 6, \"happy birthday!\"")
@ -739,7 +739,7 @@ Value sendfrom(const Array& params, bool fHelp)
"\nArguments:\n"
"1. \"fromaccount\" (string, required) The name of the account to send funds from. May be the default account using \"\".\n"
"2. \"tobitcoinaddress\" (string, required) The bitcoin address to send funds to.\n"
"3. amount (numeric, required) The amount in btc. (transaction fee is added on top).\n"
"3. amount (numeric, required) The amount in doge. (transaction fee is added on top).\n"
"4. minconf (numeric, optional, default=1) Only use funds with at least this many confirmations.\n"
"5. \"comment\" (string, optional) A comment used to store what the transaction is for. \n"
" This is not part of the transaction, just kept in your wallet.\n"
@ -749,12 +749,12 @@ Value sendfrom(const Array& params, bool fHelp)
"\nResult:\n"
"\"transactionid\" (string) The transaction id. (view at https://blockchain.info/tx/[transactionid])\n"
"\nExamples:\n"
"\nSend 0.01 btc from the default account to the address, must have at least 1 confirmation\n"
+ HelpExampleCli("sendfrom", "\"\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01") +
"\nSend 0.01 from the tabby account to the given address, funds must have at least 6 confirmations\n"
+ HelpExampleCli("sendfrom", "\"tabby\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01 6 \"donation\" \"seans outpost\"") +
"\nSend 10.01 doge from the default account to the address, must have at least 1 confirmation\n"
+ HelpExampleCli("sendfrom", "\"\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 10.01") +
"\nSend 10.01 doge from the tabby account to the given address, funds must have at least 6 confirmations\n"
+ HelpExampleCli("sendfrom", "\"tabby\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 10.01 6 \"donation\" \"seans outpost\"") +
"\nAs a json rpc call\n"
+ HelpExampleRpc("sendfrom", "\"tabby\", \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.01, 6, \"donation\", \"seans outpost\"")
+ HelpExampleRpc("sendfrom", "\"tabby\", \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 10.01, 6, \"donation\", \"seans outpost\"")
);
string strAccount = AccountFromValue(params[0]);
@ -800,7 +800,7 @@ Value sendmany(const Array& params, bool fHelp)
"1. \"fromaccount\" (string, required) The account to send the funds from, can be \"\" for the default account\n"
"2. \"amounts\" (string, required) A json object with addresses and amounts\n"
" {\n"
" \"address\":amount (numeric) The bitcoin address is the key, the numeric amount in btc is the value\n"
" \"address\":amount (numeric) The bitcoin address is the key, the numeric amount in doge is the value\n"
" ,...\n"
" }\n"
"3. minconf (numeric, optional, default=1) Only use the balance confirmed at least this many times.\n"
@ -1044,7 +1044,7 @@ Value listreceivedbyaddress(const Array& params, bool fHelp)
" {\n"
" \"address\" : \"receivingaddress\", (string) The receiving address\n"
" \"account\" : \"accountname\", (string) The account of the receiving address. The default account is \"\".\n"
" \"amount\" : x.xxx, (numeric) The total amount in btc received by the address\n"
" \"amount\" : x.xxx, (numeric) The total amount in doge received by the address\n"
" \"confirmations\" : n (numeric) The number of confirmations of the most recent transaction included\n"
" }\n"
" ,...\n"
@ -1198,10 +1198,10 @@ Value listtransactions(const Array& params, bool fHelp)
" transaction between accounts, and not associated with an address,\n"
" transaction id or block. 'send' and 'receive' transactions are \n"
" associated with an address, transaction id and block details\n"
" \"amount\": x.xxx, (numeric) The amount in btc. This is negative for the 'send' category, and for the\n"
" \"amount\": x.xxx, (numeric) The amount in doge. This is negative for the 'send' category, and for the\n"
" 'move' category for moves outbound. It is positive for the 'receive' category,\n"
" and for the 'move' category for inbound funds.\n"
" \"fee\": x.xxx, (numeric) The amount of the fee in btc. This is negative and only available for the \n"
" \"fee\": x.xxx, (numeric) The amount of the fee in doge. This is negative and only available for the \n"
" 'send' category of transactions.\n"
" \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and \n"
" 'receive' category of transactions.\n"
@ -1368,9 +1368,9 @@ Value listsinceblock(const Array& params, bool fHelp)
" \"account\":\"accountname\", (string) The account name associated with the transaction. Will be \"\" for the default account.\n"
" \"address\":\"bitcoinaddress\", (string) The bitcoin address of the transaction. Not present for move transactions (category = move).\n"
" \"category\":\"send|receive\", (string) The transaction category. 'send' has negative amounts, 'receive' has positive amounts.\n"
" \"amount\": x.xxx, (numeric) The amount in btc. This is negative for the 'send' category, and for the 'move' category for moves \n"
" \"amount\": x.xxx, (numeric) The amount in doge. This is negative for the 'send' category, and for the 'move' category for moves \n"
" outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds.\n"
" \"fee\": x.xxx, (numeric) The amount of the fee in btc. This is negative and only available for the 'send' category of transactions.\n"
" \"fee\": x.xxx, (numeric) The amount of the fee in doge. This is negative and only available for the 'send' category of transactions.\n"
" \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions.\n"
" \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive' category of transactions.\n"
" \"blockindex\": n, (numeric) The block index containing the transaction. Available for 'send' and 'receive' category of transactions.\n"
@ -1442,7 +1442,7 @@ Value gettransaction(const Array& params, bool fHelp)
"1. \"txid\" (string, required) The transaction id\n"
"\nResult:\n"
"{\n"
" \"amount\" : x.xxx, (numeric) The transaction amount in btc\n"
" \"amount\" : x.xxx, (numeric) The transaction amount in doge\n"
" \"confirmations\" : n, (numeric) The number of confirmations\n"
" \"blockhash\" : \"hash\", (string) The block hash\n"
" \"blockindex\" : xx, (numeric) The block index\n"
@ -1455,7 +1455,7 @@ Value gettransaction(const Array& params, bool fHelp)
" \"account\" : \"accountname\", (string) The account name involved in the transaction, can be \"\" for the default account.\n"
" \"address\" : \"bitcoinaddress\", (string) The bitcoin address involved in the transaction\n"
" \"category\" : \"send|receive\", (string) The category, either 'send' or 'receive'\n"
" \"amount\" : x.xxx (numeric) The amount in btc\n"
" \"amount\" : x.xxx (numeric) The amount in doge\n"
" }\n"
" ,...\n"
" ],\n"
@ -1871,7 +1871,7 @@ Value settxfee(const Array& params, bool fHelp)
"settxfee amount\n"
"\nSet the transaction fee per kB.\n"
"\nArguments:\n"
"1. amount (numeric, required) The transaction fee in BTC/kB rounded to the nearest 0.00000001\n"
"1. amount (numeric, required) The transaction fee in DOGE/kB rounded to the nearest 0.00000001\n"
"\nResult\n"
"true|false (boolean) Returns true if successful\n"
"\nExamples:\n"