diff --git a/include/log.hpp b/include/log.hpp new file mode 100644 index 0000000..f76f4d3 --- /dev/null +++ b/include/log.hpp @@ -0,0 +1,14 @@ +#pragma once +#include +#include +#include "transactions.hpp" + +struct Log +{ + std::array data; + void AddTrans(const Transaction &v) + { + std::rotate(data.begin(), data.begin() + 1, data.end()); + data[99] = std::move(v); + } +}; diff --git a/include/transactions.hpp b/include/transactions.hpp new file mode 100644 index 0000000..1d6f510 --- /dev/null +++ b/include/transactions.hpp @@ -0,0 +1,29 @@ +#pragma once +#include + +struct Transaction +{ + std::string from = "", to = ""; + uint32_t amount = 0; + bool recieving = false; + + void Concatinate(std::string &s) + { + if (s.size() > 10) + { + s.resize(10); + s[7] = '.'; + s[8] = '.'; + s[9] = '.'; + } + } + + Transaction() = default; + Transaction(std::string from_str, std::string to_str, uint32_t amount, bool recieving) : amount(amount), recieving(recieving) + { + Concatinate(from_str); + Concatinate(to_str); + from = std::move(from_str); + to = std::move(to_str); + } +}; \ No newline at end of file