🐛 forgot to add files

This commit is contained in:
EntireTwix 2021-04-21 15:59:29 -07:00
parent ac24bca5d9
commit 666258519a
2 changed files with 43 additions and 0 deletions

14
include/log.hpp Normal file
View file

@ -0,0 +1,14 @@
#pragma once
#include <array>
#include <algorithm>
#include "transactions.hpp"
struct Log
{
std::array<Transaction, 100> data;
void AddTrans(const Transaction &v)
{
std::rotate(data.begin(), data.begin() + 1, data.end());
data[99] = std::move(v);
}
};

29
include/transactions.hpp Normal file
View file

@ -0,0 +1,29 @@
#pragma once
#include <cstdint>
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);
}
};