gp.label->setText(QString("Enter the password for the account %2 (%1).").arg(QString::fromStdString(_a.abridged())).arg(QString::fromStdString(info.first)));
gp.label->setText(QString("Enter the password for the account %2 (%1).").arg(QString::fromStdString(_address.abridged())).arg(QString::fromStdString(m_keyManager.accountName(_address))));
if(s||QMessageBox::warning(nullptr,"Unlock Account","The password you gave is incorrect for this key.",QMessageBox::Retry,QMessageBox::Cancel)==QMessageBox::Cancel)
if(s||QMessageBox::warning(nullptr,"Unlock Account","The password you gave is incorrect for this key.",QMessageBox::Retry,QMessageBox::Cancel)==QMessageBox::Cancel)
QStrings=QInputDialog::getText(this,"Import Account Key","Enter this account's name");
QStrings=QInputDialog::getText(this,"Import Account Key","Enter this account's name");
if(QMessageBox::question(this,"Additional Security?","Would you like to use additional security for this key? This lets you protect it with a different password to other keys, but also means you must re-enter the key's password every time you wish to use the account.",QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes)
if(QMessageBox::question(this,"Additional Security?","Would you like to use additional security for this key? This lets you protect it with a different password to other keys, but also means you must re-enter the key's password every time you wish to use the account.",QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes)
QString::fromStdString("Account "+m_keyManager.accountName(h)+" ("+render(h)+") has "+formatBalance(ethereum()->balanceAt(h))+" in it.\r\nIt, and any contract that this account can access, will be lost forever if you continue. Do NOT continue unless you know what you are doing.\n"
QString::fromStdString("Account "+k.first+" ("+render(h)+") has "+formatBalance(ethereum()->balanceAt(h))+" in it.\r\nIt, and any contract that this account can access, will be lost forever if you continue. Do NOT continue unless you know what you are doing.\n"
"Are you sure you want to continue? \r\n If so, type 'YES' to confirm."),
"Are you sure you want to continue? \r\n If so, type 'YES' to confirm."),
autop=QInputDialog::getText(this,"Re-Encrypt Key","Enter the original password for this key.\nHint: "+QString::fromStdString(m_keyManager.hint(a)),QLineEdit::Password,QString()).toStdString();
autop=QInputDialog::getText(this,"Re-Encrypt Key","Enter the original password for this key.\nHint: "+QString::fromStdString(m_keyManager.passwordHint(a)),QLineEdit::Password,QString()).toStdString();
autop=QInputDialog::getText(nullptr,"Re-Encrypt Key",QString("Enter the original password for key %1.\nHint: %2").arg(QString::fromStdString(pretty(a))).arg(QString::fromStdString(m_keyManager.hint(a))),QLineEdit::Password,QString()).toStdString();
autop=QInputDialog::getText(nullptr,"Re-Encrypt Key",QString("Enter the original password for key %1.\nHint: %2").arg(QString::fromStdString(pretty(a))).arg(QString::fromStdString(m_keyManager.passwordHint(a))),QLineEdit::Password,QString()).toStdString();
usingTopicMask=std::vector<std::pair<AbridgedTopic,AbridgedTopic>>;// where pair::first is the actual abridged topic hash, pair::second is a constant (probably redundunt)
//Check the fields restored from RLP to original fields
//Check the fields restored from RLP to original fields
BOOST_CHECK_MESSAGE(blockHeaderFromFields.headerHash(WithNonce)==blockFromRlp.headerHash(WithNonce),"hash in given RLP not matching the block hash!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.headerHash(WithNonce)==blockFromRlp.headerHash(WithNonce)),"hash in given RLP not matching the block hash!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.parentHash==blockFromRlp.parentHash,"parentHash in given RLP not matching the block parentHash!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.parentHash==blockFromRlp.parentHash),"parentHash in given RLP not matching the block parentHash!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.sha3Uncles==blockFromRlp.sha3Uncles,"sha3Uncles in given RLP not matching the block sha3Uncles!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.sha3Uncles==blockFromRlp.sha3Uncles),"sha3Uncles in given RLP not matching the block sha3Uncles!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.coinbaseAddress==blockFromRlp.coinbaseAddress,"coinbaseAddress in given RLP not matching the block coinbaseAddress!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.coinbaseAddress==blockFromRlp.coinbaseAddress),"coinbaseAddress in given RLP not matching the block coinbaseAddress!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.stateRoot==blockFromRlp.stateRoot,"stateRoot in given RLP not matching the block stateRoot!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.stateRoot==blockFromRlp.stateRoot),"stateRoot in given RLP not matching the block stateRoot!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.transactionsRoot==blockFromRlp.transactionsRoot,"transactionsRoot in given RLP not matching the block transactionsRoot!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.transactionsRoot==blockFromRlp.transactionsRoot),"transactionsRoot in given RLP not matching the block transactionsRoot!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.receiptsRoot==blockFromRlp.receiptsRoot,"receiptsRoot in given RLP not matching the block receiptsRoot!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.receiptsRoot==blockFromRlp.receiptsRoot),"receiptsRoot in given RLP not matching the block receiptsRoot!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.logBloom==blockFromRlp.logBloom,"logBloom in given RLP not matching the block logBloom!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.logBloom==blockFromRlp.logBloom),"logBloom in given RLP not matching the block logBloom!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.difficulty==blockFromRlp.difficulty,"difficulty in given RLP not matching the block difficulty!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.difficulty==blockFromRlp.difficulty),"difficulty in given RLP not matching the block difficulty!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.number==blockFromRlp.number,"number in given RLP not matching the block number!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.number==blockFromRlp.number),"number in given RLP not matching the block number!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.gasLimit==blockFromRlp.gasLimit,"gasLimit in given RLP not matching the block gasLimit!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.gasLimit==blockFromRlp.gasLimit),"gasLimit in given RLP not matching the block gasLimit!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.gasUsed==blockFromRlp.gasUsed,"gasUsed in given RLP not matching the block gasUsed!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.gasUsed==blockFromRlp.gasUsed),"gasUsed in given RLP not matching the block gasUsed!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.timestamp==blockFromRlp.timestamp,"timestamp in given RLP not matching the block timestamp!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.timestamp==blockFromRlp.timestamp),"timestamp in given RLP not matching the block timestamp!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.extraData==blockFromRlp.extraData,"extraData in given RLP not matching the block extraData!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.extraData==blockFromRlp.extraData),"extraData in given RLP not matching the block extraData!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.mixHash==blockFromRlp.mixHash,"mixHash in given RLP not matching the block mixHash!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.mixHash==blockFromRlp.mixHash),"mixHash in given RLP not matching the block mixHash!");
BOOST_CHECK_MESSAGE(blockHeaderFromFields.nonce==blockFromRlp.nonce,"nonce in given RLP not matching the block nonce!");
TBOOST_CHECK_MESSAGE((blockHeaderFromFields.nonce==blockFromRlp.nonce),"nonce in given RLP not matching the block nonce!");
BOOST_CHECK_MESSAGE(txsFromRlp.size()==txsFromField.size(),"transaction list size does not match");
TBOOST_CHECK_MESSAGE((txsFromRlp.size()==txsFromField.size()),"transaction list size does not match");
for(size_ti=0;i<txsFromField.size();++i)
for(size_ti=0;i<txsFromField.size();++i)
{
{
BOOST_CHECK_MESSAGE(txsFromField[i].data()==txsFromRlp[i].data(),"transaction data in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].data()==txsFromRlp[i].data()),"transaction data in rlp and in field do not match");
BOOST_CHECK_MESSAGE(txsFromField[i].gas()==txsFromRlp[i].gas(),"transaction gasLimit in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].gas()==txsFromRlp[i].gas()),"transaction gasLimit in rlp and in field do not match");
BOOST_CHECK_MESSAGE(txsFromField[i].gasPrice()==txsFromRlp[i].gasPrice(),"transaction gasPrice in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].gasPrice()==txsFromRlp[i].gasPrice()),"transaction gasPrice in rlp and in field do not match");
BOOST_CHECK_MESSAGE(txsFromField[i].nonce()==txsFromRlp[i].nonce(),"transaction nonce in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].nonce()==txsFromRlp[i].nonce()),"transaction nonce in rlp and in field do not match");
BOOST_CHECK_MESSAGE(txsFromField[i].signature().r==txsFromRlp[i].signature().r,"transaction r in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].signature().r==txsFromRlp[i].signature().r),"transaction r in rlp and in field do not match");
BOOST_CHECK_MESSAGE(txsFromField[i].signature().s==txsFromRlp[i].signature().s,"transaction s in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].signature().s==txsFromRlp[i].signature().s),"transaction s in rlp and in field do not match");
BOOST_CHECK_MESSAGE(txsFromField[i].signature().v==txsFromRlp[i].signature().v,"transaction v in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].signature().v==txsFromRlp[i].signature().v),"transaction v in rlp and in field do not match");
BOOST_CHECK_MESSAGE(txsFromField[i].receiveAddress()==txsFromRlp[i].receiveAddress(),"transaction receiveAddress in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].receiveAddress()==txsFromRlp[i].receiveAddress()),"transaction receiveAddress in rlp and in field do not match");
BOOST_CHECK_MESSAGE(txsFromField[i].value()==txsFromRlp[i].value(),"transaction receiveAddress in rlp and in field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].value()==txsFromRlp[i].value()),"transaction receiveAddress in rlp and in field do not match");
BOOST_CHECK_MESSAGE(txsFromField[i]==txsFromRlp[i],"transactions from rlp and transaction from field do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i]==txsFromRlp[i]),"transactions from rlp and transaction from field do not match");
BOOST_CHECK_MESSAGE(txsFromField[i].rlp()==txsFromRlp[i].rlp(),"transactions rlp do not match");
TBOOST_CHECK_MESSAGE((txsFromField[i].rlp()==txsFromRlp[i].rlp()),"transactions rlp do not match");
//Check the fields restored from RLP to original fields
//Check the fields restored from RLP to original fields
BOOST_CHECK_MESSAGE(txFromFields.data()==txFromRlp.data(),"Data in given RLP not matching the Transaction data!");
TBOOST_CHECK_MESSAGE((txFromFields.data()==txFromRlp.data()),"Data in given RLP not matching the Transaction data!");
BOOST_CHECK_MESSAGE(txFromFields.value()==txFromRlp.value(),"Value in given RLP not matching the Transaction value!");
TBOOST_CHECK_MESSAGE((txFromFields.value()==txFromRlp.value()),"Value in given RLP not matching the Transaction value!");
BOOST_CHECK_MESSAGE(txFromFields.gasPrice()==txFromRlp.gasPrice(),"GasPrice in given RLP not matching the Transaction gasPrice!");
TBOOST_CHECK_MESSAGE((txFromFields.gasPrice()==txFromRlp.gasPrice()),"GasPrice in given RLP not matching the Transaction gasPrice!");
BOOST_CHECK_MESSAGE(txFromFields.gas()==txFromRlp.gas(),"Gas in given RLP not matching the Transaction gas!");
TBOOST_CHECK_MESSAGE((txFromFields.gas()==txFromRlp.gas()),"Gas in given RLP not matching the Transaction gas!");
BOOST_CHECK_MESSAGE(txFromFields.nonce()==txFromRlp.nonce(),"Nonce in given RLP not matching the Transaction nonce!");
TBOOST_CHECK_MESSAGE((txFromFields.nonce()==txFromRlp.nonce()),"Nonce in given RLP not matching the Transaction nonce!");
BOOST_CHECK_MESSAGE(txFromFields.receiveAddress()==txFromRlp.receiveAddress(),"Receive address in given RLP not matching the Transaction 'to' address!");
TBOOST_CHECK_MESSAGE((txFromFields.receiveAddress()==txFromRlp.receiveAddress()),"Receive address in given RLP not matching the Transaction 'to' address!");
BOOST_CHECK_MESSAGE(txFromFields.sender()==txFromRlp.sender(),"Transaction sender address in given RLP not matching the Transaction 'vrs' signature!");
TBOOST_CHECK_MESSAGE((txFromFields.sender()==txFromRlp.sender()),"Transaction sender address in given RLP not matching the Transaction 'vrs' signature!");
BOOST_CHECK_MESSAGE(txFromFields.sender()==addressReaded||txFromRlp.sender()==addressReaded,"Signature address of sender does not match given sender address!");
TBOOST_CHECK_MESSAGE((txFromFields.sender()==addressReaded||txFromRlp.sender()==addressReaded),"Signature address of sender does not match given sender address!");