mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-19 01:22:14 +11:00
Merge branch 'main' of https://github.com/EntireTwix/CCash
This commit is contained in:
commit
56aa6f31f0
2 changed files with 7 additions and 4 deletions
|
|
@ -2,15 +2,18 @@
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
//42 bytes total
|
|
||||||
struct Transaction
|
struct Transaction
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string from = "", to = "";
|
std::string from = "", to = "";
|
||||||
uint32_t amount = 0;
|
uint32_t amount = 0;
|
||||||
uint64_t time = 0;
|
uint64_t time = 0;
|
||||||
|
|
||||||
Transaction() = default;
|
Transaction() = default;
|
||||||
|
Transaction(std::string from_str, std::string to_str, uint32_t amount, uint64_t time) : amount(amount), time(time)
|
||||||
|
{
|
||||||
|
from = std::move(from_str);
|
||||||
|
to = std::move(to_str);
|
||||||
|
}
|
||||||
Transaction(std::string from_str, std::string to_str, uint32_t amount) : amount(amount)
|
Transaction(std::string from_str, std::string to_str, uint32_t amount) : amount(amount)
|
||||||
{
|
{
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ struct User
|
||||||
}
|
}
|
||||||
for (uint32_t i = 0; i < log.end; ++i)
|
for (uint32_t i = 0; i < log.end; ++i)
|
||||||
{
|
{
|
||||||
log.data[i] = std::move(Transaction(log_j[i]["from"].asCString(), log_j[i]["to"].asCString(), log_j[i]["amount"].asUInt()));
|
log.data[i] = std::move(Transaction(log_j[i]["from"].asCString(), log_j[i]["to"].asCString(), log_j[i]["amount"].asUInt(), log_j[i]["time"].asUInt64()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue