Skip to content

Commit

Permalink
native_tests: Fix funky
Browse files Browse the repository at this point in the history
  • Loading branch information
jumpsiegel committed Apr 24, 2024
1 parent 90f3c9e commit e1ec644
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/flamenco/runtime/tests/fd_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
#include "../sysvar/fd_sysvar_rent.h"
#include "../sysvar/fd_sysvar_slot_hashes.h"

#pragma GCC diagnostic ignored "-Wformat"
#pragma GCC diagnostic ignored "-Wformat-extra-args"

const char *verbose = NULL;
const char *fail_fast = NULL;

Expand Down Expand Up @@ -258,6 +255,7 @@ int fd_executor_run_test(
slot_ctx->blockstore = suite->blockstore;

/* Prepare a new Funk transaction to execute this test in */
fd_funk_start_write( slot_ctx->acc_mgr->funk );
fd_funk_txn_xid_t xid;
fd_funk_txn_xid_set_unique( &xid );
slot_ctx->funk_txn = fd_funk_txn_prepare( slot_ctx->acc_mgr->funk, NULL, &xid, 1 );
Expand Down Expand Up @@ -306,6 +304,7 @@ int fd_executor_run_test(
if ( fd_recent_block_hashes_decode( &slot_ctx->slot_bank.recent_block_hashes, &ctx2 ) ) {
FD_LOG_WARNING(("fd_recent_block_hashes_decode failed"));
ret = FD_EXECUTOR_INSTR_ERR_INVALID_ACC_DATA;
fd_funk_end_write( slot_ctx->acc_mgr->funk );
goto fd_executor_run_cleanup;
}
}
Expand Down Expand Up @@ -414,6 +413,8 @@ int fd_executor_run_test(
int exec_result = fd_execute_instr( &txn_ctx, &instr );
fd_execute_txn_finalize( slot_ctx, &txn_ctx, exec_result );

fd_funk_end_write( slot_ctx->acc_mgr->funk );

if ( exec_result != test->expected_result ) {
if (NULL != verbose)
log_test_fail( test, suite, "expected transaction result %d, got %d: %s", test->expected_result, exec_result, test->bt );
Expand Down Expand Up @@ -585,7 +586,9 @@ int fd_executor_run_test(
/* Revert the Funk transaction */
fd_executor_run_cleanup:
free( fd_sysvar_cache_delete( slot_ctx->sysvar_cache ) );
fd_funk_start_write( slot_ctx->acc_mgr->funk );
fd_funk_txn_cancel( suite->funk, slot_ctx->funk_txn, 0 );
fd_funk_end_write( slot_ctx->acc_mgr->funk );
fd_bincode_destroy_ctx_t destroy_ctx = { .valloc = slot_ctx->valloc };
fd_slot_bank_destroy(&slot_ctx->slot_bank, &destroy_ctx);
fd_wksp_free_laddr( epoch_ctx_mem );
Expand Down

0 comments on commit e1ec644

Please sign in to comment.