refactor Transaction. compiling. still need to test

This commit is contained in:
jed
2012-11-14 13:05:59 -08:00
parent c1611f3b07
commit 5bbdd90a4c
23 changed files with 1515 additions and 1516 deletions

View File

@@ -0,0 +1,51 @@
#include "RegularKeySetTransactor.h"
#include "Log.h"
SETUP_LOG();
// TODO:
TER RegularKeySetTransactor::checkSig()
{
// Transaction's signing public key must be for the source account.
// To prove the master private key made this transaction.
if (mSigningPubKey.getAccountID() != mTxnAccountID)
{
// Signing Pub Key must be for Source Account ID.
cLog(lsWARNING) << "sourceAccountID: " << mSigningPubKey.humanAccountID();
cLog(lsWARNING) << "txn accountID: " << mTxn.getSourceAccount().humanAccountID();
return temBAD_SET_ID;
}
return tesSUCCESS;
}
// TODO: this should be default fee if flag isn't set
void RegularKeySetTransactor::calculateFee()
{
mFeeDue = 0;
}
// TODO: change to take a fee if there is one there
TER RegularKeySetTransactor::doApply()
{
std::cerr << "doRegularKeySet>" << std::endl;
if (mTxnAccount->getFlags() & lsfPasswordSpent)
{
std::cerr << "doRegularKeySet: Delay transaction: Funds already spent." << std::endl;
return terFUNDS_SPENT;
}
mTxnAccount->setFlag(lsfPasswordSpent);
uint160 uAuthKeyID=mTxn.getFieldAccount160(sfAuthorizedKey);
mTxnAccount->setFieldAccount(sfAuthorizedKey, uAuthKeyID);
std::cerr << "doRegularKeySet<" << std::endl;
return tesSUCCESS;
}