diff --git a/utt/e2e/src/main.cpp b/utt/e2e/src/main.cpp index 95cdccd453..d922e279fe 100644 --- a/utt/e2e/src/main.cpp +++ b/utt/e2e/src/main.cpp @@ -2,6 +2,9 @@ #include "wallet.hpp" #include #include +#include + +using namespace libutt; Admin::Channel createAdminChannel(grpc::ClientContext &ctxAdmin) { Admin::Connection connAdmin; @@ -49,21 +52,21 @@ int main(int argc, char *argv[]) { config = Wallet::getPublicConfig(chanWallet); - std::cout << "Configure wallet 1\n"; + logdbg << "Configuring wallets 1 - 3" << std::endl; wallet1 = std::make_unique("user-1", pki, config); wallet1->registerUser(chanWallet); - std::cout << "Configure wallet 3\n"; + logdbg << "Configuring wallet3" << std::endl; wallet3 = std::make_unique("user-3", pki, config); wallet3->registerUser(chanWallet); - std::cout << "Configure wallet 2\n"; + logdbg << "Configuring wallet2" << std::endl; wallet2 = std::make_unique("user-2", pki, config); wallet2->registerUser(chanWallet); + logdbg << "Wallets configured. Minting and creating privacy budget..." << std::endl; wallet1->mint(chanWallet, 2000); Admin::createPrivacyBudget(chanAdmin, "user-1", 10000); - // logdbg << "Private funds minted" << endl; sleep(5); uint64_t publicBalance, privateBalance; const uint64_t EXPECTED_PUBLIC_BALANCE_1_BEFORE = 8000; @@ -72,15 +75,16 @@ int main(int argc, char *argv[]) { const uint64_t EXPECTED_PRIVATE_BALANCE_2_BEFORE = 0; std::tie(publicBalance, privateBalance) = wallet1->getPublicAndPrivateBalance(chanWallet); - std::cout << "publicBalance1: " << publicBalance << ", privateBalance1: " << privateBalance << "\n"; + logdbg << "publicBalance1 before: " << publicBalance << ", privateBalance1 before: " << privateBalance << std::endl; if (publicBalance != EXPECTED_PUBLIC_BALANCE_1_BEFORE or privateBalance != EXPECTED_PRIVATE_BALANCE_1_BEFORE) return 1; std::tie(publicBalance, privateBalance) = wallet2->getPublicAndPrivateBalance(chanWallet); - std::cout << "publicBalance2: " << publicBalance << ", privateBalance2: " << privateBalance << "\n"; + logdbg << "publicBalance2 before: " << publicBalance << ", privateBalance2 before: " << privateBalance << std::endl; if (publicBalance != EXPECTED_PUBLIC_BALANCE_2_BEFORE or privateBalance != EXPECTED_PRIVATE_BALANCE_2_BEFORE) return 1; + logdbg << "Performing transfer and burn" << std::endl; wallet1->transfer(chanWallet, 800, "user-2"); wallet1->burn(chanWallet, 700); @@ -90,13 +94,13 @@ int main(int argc, char *argv[]) { const uint64_t EXPECTED_PRIVATE_BALANCE_2_AFTER = 800; std::tie(publicBalance, privateBalance) = wallet1->getPublicAndPrivateBalance(chanWallet); - std::cout << "publicBalance1: " << publicBalance << ", privateBalance1: " << privateBalance << "\n"; + logdbg << "publicBalance1 after: " << publicBalance << ", privateBalance1 after: " << privateBalance << "\n"; if (publicBalance != EXPECTED_PUBLIC_BALANCE_1_AFTER or privateBalance != EXPECTED_PRIVATE_BALANCE_1_AFTER) return 1; std::tie(publicBalance, privateBalance) = wallet2->getPublicAndPrivateBalance(chanWallet); - std::cout << "publicBalance2: " << publicBalance << ", privateBalance2: " << privateBalance << "\n"; + logdbg << "publicBalance2 after: " << publicBalance << ", privateBalance2 after: " << privateBalance << "\n"; if (publicBalance != EXPECTED_PUBLIC_BALANCE_2_AFTER or privateBalance != EXPECTED_PRIVATE_BALANCE_2_AFTER) return 1; - std::cout << "TEST PASSED\n"; + logdbg << "TEST PASSED\n"; return 0; } \ No newline at end of file