mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove debug printf and add transaction type to string function for both hedera and gradido transactions
This commit is contained in:
parent
191222872d
commit
ecf2a3a407
@ -304,7 +304,7 @@ namespace model {
|
||||
auto sigBytes = sigPair->mutable_ed25519();
|
||||
*sigBytes = std::string((char*)*sign, crypto_sign_BYTES);
|
||||
auto sign_hex_string = DataTypeConverter::binToHex(sign);
|
||||
printf("sign hex: %s\n", sign_hex_string.data());
|
||||
//printf("sign hex: %s\n", sign_hex_string.data());
|
||||
mm->releaseMemory(sign);
|
||||
|
||||
updateRequestInDB();
|
||||
@ -323,7 +323,7 @@ namespace model {
|
||||
}
|
||||
|
||||
//getModel()->updateIntoDB("request", )
|
||||
printf("[Transaction::sign] reference-count: %d\n", mReferenceCount);
|
||||
//printf("[Transaction::sign] reference-count: %d\n", mReferenceCount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -570,8 +570,10 @@ namespace model {
|
||||
auto hedera_precheck_code_string = hedera_transaction_response->getPrecheckCodeString();
|
||||
auto precheck_code = hedera_transaction_response->getPrecheckCode();
|
||||
auto cost = hedera_transaction_response->getCost();
|
||||
|
||||
printf("hedera response: %s, cost: %" PRIu64 "\n", hedera_precheck_code_string.data(), cost);
|
||||
|
||||
printf("hedera response: %s, cost: %" PRIu64 ", type: %s\n",
|
||||
hedera_precheck_code_string.data(), cost,
|
||||
TransactionBody::transactionTypeToString(mTransactionBody->getType()));
|
||||
if (precheck_code == proto::INVALID_TRANSACTION_START) {
|
||||
int zahl = 0;
|
||||
return -5;
|
||||
@ -583,8 +585,8 @@ namespace model {
|
||||
// trigger community server update in 5 seconds
|
||||
Poco::DateTime now;
|
||||
std::string now_string = Poco::DateTimeFormatter::format(now, "%f.%m.%Y %H:%M:%S");
|
||||
printf("[%s] trigger community server update in 5 second, now: %s\n", function_name, now_string.data());
|
||||
CronManager::getInstance()->scheduleUpdateRun(Poco::Timespan(5000, 0));
|
||||
//printf("[%s] trigger community server update in 5 second, now: %s\n", function_name, now_string.data());
|
||||
CronManager::getInstance()->scheduleUpdateRun(Poco::Timespan(5, 0));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -686,7 +688,7 @@ namespace model {
|
||||
return 0;
|
||||
}*/
|
||||
result = mTransaction->runSendTransaction();
|
||||
printf("[SendTransactionTask::run] result: %d\n", result);
|
||||
//printf("[SendTransactionTask::run] result: %d\n", result);
|
||||
// delete because of error
|
||||
if (-1 == result) {
|
||||
mTransaction->deleteFromDB();
|
||||
|
||||
@ -172,6 +172,18 @@ namespace model {
|
||||
return "<uninitalized>";
|
||||
}
|
||||
|
||||
const char* TransactionBody::transactionTypeToString(TransactionType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case model::gradido::TRANSACTION_NONE: return "NONE";
|
||||
case model::gradido::TRANSACTION_CREATION: return "Creation";
|
||||
case model::gradido::TRANSACTION_TRANSFER: return "Transfer";
|
||||
case model::gradido::TRANSACTION_GROUP_MEMBER_UPDATE: return "Group Member Update";
|
||||
}
|
||||
return "<unknown>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
TransactionCreation* TransactionBody::getCreationTransaction()
|
||||
|
||||
@ -41,6 +41,7 @@ namespace model {
|
||||
static Poco::AutoPtr<TransactionBody> load(const std::string& protoMessageBin);
|
||||
|
||||
inline TransactionType getType() { Poco::ScopedLock<Poco::Mutex> _lock(mWorkMutex); return mType; }
|
||||
static const char* transactionTypeToString(TransactionType type);
|
||||
std::string getMemo();
|
||||
void setMemo(const std::string& memo);
|
||||
|
||||
|
||||
@ -113,6 +113,17 @@ namespace model {
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* TransactionBody::TransactionBodyTypeToString(TransactionBodyType type)
|
||||
{
|
||||
switch (type) {
|
||||
case TRANSACTION_CONSENSUS_CREATE_TOPIC: return "Consensus Create Topic";
|
||||
case TRANSACTION_CONSENSUS_SUBMIT_MESSAGE: return "Consensus Submit Message";
|
||||
case TRANSACTION_CRYPTO_CREATE: return "Crypto Create";
|
||||
case TRANSACTION_CRYPTO_TRANSFER: return "Crypto Transfer";
|
||||
}
|
||||
return "<unknown>";
|
||||
}
|
||||
|
||||
void TransactionBody::setMemo(const std::string& memo)
|
||||
{
|
||||
mTransactionBody.set_memo(memo);
|
||||
@ -136,7 +147,7 @@ namespace model {
|
||||
timestamp->set_nanos(microseconds * 1000);
|
||||
// make sure timestamp is some nanos old
|
||||
//timestamp->set_nanos(microseconds * 900);
|
||||
printf("hedera transaction body timestamp: %d.%d\n", timestamp->seconds(), timestamp->nanos());
|
||||
// printf("hedera transaction body timestamp: %d.%d\n", timestamp->seconds(), timestamp->nanos());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -50,6 +50,7 @@ namespace model {
|
||||
inline std::string getConnectionString() const { return mConnection.getUriWithPort(); }
|
||||
inline controller::NodeServerConnection getConnection() const { return mConnection; }
|
||||
inline TransactionBodyType getType() const { return mType; }
|
||||
static const char* TransactionBodyTypeToString(TransactionBodyType type);
|
||||
|
||||
void updateTimestamp();
|
||||
protected:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user