Skip to content

Commit

Permalink
Changed test.sh to support cfg file for unit tests. Comment to remove…
Browse files Browse the repository at this point in the history
… 'send_mint_to' in future. Fixed shard test for mint tx

Signed-off-by: Dave Bryson <[email protected]>
  • Loading branch information
davebryson committed Jun 2, 2022
1 parent c12751b commit b6993d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ run_test_suite () {
}

echo "Running unit tests..."
cp tests/unit/*.cfg $BUILD_DIR
run_test_suite "tests/unit/run_unit_tests" "unit_tests_coverage"

echo "Running integration tests..."
Expand Down
2 changes: 2 additions & 0 deletions src/uhs/client/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ namespace cbdc {
/// \brief Sends the given minting transaction to a service that will
/// accept and process it.
///
/// TODO: Remove. No longer needed
///
/// Called by \ref mint to send the resulting transaction. Subclasses
/// should define custom transmission logic here.
/// \param mint_tx invalid transaction that mints new coins.
Expand Down
10 changes: 3 additions & 7 deletions tests/unit/shard_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,10 @@ TEST_F(shard_test, digest_tx_empty_inputs) {
ctx.m_inputs = {};
ctx.m_uhs_outputs = {{'x'}, {'y'}};

// Txs without inputs are valid mint txs
auto res = m_shard.digest_transaction(ctx);
ASSERT_TRUE(std::holds_alternative<cbdc::watchtower::tx_error>(res));
auto got = std::get<cbdc::watchtower::tx_error>(res);

cbdc::watchtower::tx_error want{{'a'},
cbdc::watchtower::tx_error_inputs_dne{{}}};

ASSERT_EQ(got, want);
ASSERT_TRUE(
std::holds_alternative<cbdc::atomizer::tx_notify_request>(res));
}

TEST_F(shard_test, digest_tx_inputs_dne) {
Expand Down

0 comments on commit b6993d5

Please sign in to comment.