From 01c6f40f579799a978c0986b67c41af0b908f9da Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Tue, 30 Jun 2026 13:30:42 +0300 Subject: [PATCH 1/5] feat: cleaning all wrongt naming --- CMakeLists.txt | 8 +- README.md | 2 +- flake.nix | 2 +- justfile | 6 +- metadata.json | 14 +-- ..._wallet_module.cpp => lez_core_module.cpp} | 94 +++++++++---------- ...zone_wallet_module.h => lez_core_module.h} | 29 +++--- 7 files changed, 74 insertions(+), 81 deletions(-) rename src/{logos_execution_zone_wallet_module.cpp => lez_core_module.cpp} (92%) rename src/{logos_execution_zone_wallet_module.h => lez_core_module.h} (83%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e6bae5..2e9bb2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.14) -project(LogosExecutionZone LANGUAGES CXX) +project(LEZCore LANGUAGES CXX) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -12,10 +12,10 @@ else() endif() logos_module( - NAME logos_execution_zone + NAME lez_core SOURCES - src/logos_execution_zone_wallet_module.h - src/logos_execution_zone_wallet_module.cpp + src/lez_core_module.h + src/lez_core_module.cpp EXTERNAL_LIBS wallet_ffi ) diff --git a/README.md b/README.md index edb9259..b76f648 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Logos Blockchain Module +# Logos Execution Zone Core Module ### Setup diff --git a/flake.nix b/flake.nix index b35fc50..48e324e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Logos Execution Zone Wallet Module"; + description = "Logos Execution Zone Core Module"; inputs = { logos-module-builder.url = "github:logos-co/logos-module-builder"; diff --git a/justfile b/justfile index 19a87c2..774fdab 100644 --- a/justfile +++ b/justfile @@ -3,11 +3,11 @@ default: build configure: cmake -S . -B build -G Ninja \ ${LOGOS_CORE_ROOT:+-DLOGOS_CORE_ROOT="$LOGOS_CORE_ROOT"} \ - ${LOGOS_EXECUTION_ZONE_WALLET_LIB:+-DLOGOS_EXECUTION_ZONE_WALLET_LIB="$LOGOS_EXECUTION_ZONE_WALLET_LIB"} \ - ${LOGOS_EXECUTION_ZONE_WALLET_INCLUDE:+-DLOGOS_EXECUTION_ZONE_WALLET_INCLUDE="$LOGOS_EXECUTION_ZONE_WALLET_INCLUDE"} + ${LEZ_CORE_LIB:+-DLEZ_CORE_LIB="$LEZ_CORE_LIB"} \ + ${LEZ_CORE_INCLUDE:+-DLEZ_CORE_INCLUDE="$LEZ_CORE_INCLUDE"} build: configure - cmake --build build --parallel --target lez_wallet_module_plugin + cmake --build build --parallel --target lez_core_module_plugin clean: rm -rf build result diff --git a/metadata.json b/metadata.json index 7469dd1..4bbc267 100644 --- a/metadata.json +++ b/metadata.json @@ -1,17 +1,17 @@ { - "name": "logos_execution_zone", - "display_name": "LEZ Module", - "version": "1.0.0", - "description": "Logos Execution Zone Module for Logos Core", + "name": "lez_core", + "display_name": "LEZ Core Module", + "version": "0.2.0", + "description": "Logos Execution Zone Core Module for Logos Core", "author": "Logos Blockchain Team", "type": "core", "category": "blockchain", "interface": "universal", "codegen": { - "impl_header": "src/logos_execution_zone_wallet_module.h", - "impl_class": "LogosExecutionZoneWalletModule" + "impl_header": "src/lez_core_module.h", + "impl_class": "LEZCoreModule" }, - "main": "logos_execution_zone_plugin", + "main": "lez_core_plugin", "dependencies": [], "capabilities": [], "include": [], diff --git a/src/logos_execution_zone_wallet_module.cpp b/src/lez_core_module.cpp similarity index 92% rename from src/logos_execution_zone_wallet_module.cpp rename to src/lez_core_module.cpp index 0eadbc2..d49c373 100644 --- a/src/logos_execution_zone_wallet_module.cpp +++ b/src/lez_core_module.cpp @@ -1,4 +1,4 @@ -#include "logos_execution_zone_wallet_module.h" +#include "lez_core_module.h" #include #include @@ -263,26 +263,26 @@ bool jsonArrayHexToSiblings32(const std::string& json_array_str, std::vector(block_id)); } -int64_t LogosExecutionZoneWalletModule::get_last_synced_block() { +int64_t LEZCoreModule::get_last_synced_block() { uint64_t block_id = 0; const WalletFfiError error = wallet_ffi_get_last_synced_block(walletHandle, &block_id); if (error != SUCCESS) { @@ -453,7 +453,7 @@ int64_t LogosExecutionZoneWalletModule::get_last_synced_block() { return static_cast(block_id); } -int64_t LogosExecutionZoneWalletModule::get_current_block_height() { +int64_t LEZCoreModule::get_current_block_height() { uint64_t block_height = 0; const WalletFfiError error = wallet_ffi_get_current_block_height(walletHandle, &block_height); if (error != SUCCESS) { @@ -465,7 +465,7 @@ int64_t LogosExecutionZoneWalletModule::get_current_block_height() { // === Pinata claiming === -std::string LogosExecutionZoneWalletModule::claim_pinata( +std::string LEZCoreModule::claim_pinata( const std::string& pinata_account_id_hex, const std::string& winner_account_id_hex, const std::string& solution_le16_hex @@ -491,7 +491,7 @@ std::string LogosExecutionZoneWalletModule::claim_pinata( return resultJson; } -std::string LogosExecutionZoneWalletModule::claim_pinata_private_owned_already_initialized( +std::string LEZCoreModule::claim_pinata_private_owned_already_initialized( const std::string& pinata_account_id_hex, const std::string& winner_account_id_hex, const std::string& solution_le16_hex, @@ -541,7 +541,7 @@ std::string LogosExecutionZoneWalletModule::claim_pinata_private_owned_already_i return resultJson; } -std::string LogosExecutionZoneWalletModule::claim_pinata_private_owned_not_initialized( +std::string LEZCoreModule::claim_pinata_private_owned_not_initialized( const std::string& pinata_account_id_hex, const std::string& winner_account_id_hex, const std::string& solution_le16_hex @@ -575,7 +575,7 @@ std::string LogosExecutionZoneWalletModule::claim_pinata_private_owned_not_initi // === Operations === -std::string LogosExecutionZoneWalletModule::transfer_public( +std::string LEZCoreModule::transfer_public( const std::string& from_hex, const std::string& to_hex, const std::string& amount_le16_hex @@ -603,7 +603,7 @@ std::string LogosExecutionZoneWalletModule::transfer_public( return resultJson; } -std::string LogosExecutionZoneWalletModule::transfer_shielded( +std::string LEZCoreModule::transfer_shielded( const std::string& from_hex, const std::string& to_keys_json, const std::string& amount_le16_hex @@ -648,7 +648,7 @@ std::string LogosExecutionZoneWalletModule::transfer_shielded( return resultJson; } -std::string LogosExecutionZoneWalletModule::transfer_deshielded( +std::string LEZCoreModule::transfer_deshielded( const std::string& from_hex, const std::string& to_hex, const std::string& amount_le16_hex @@ -676,7 +676,7 @@ std::string LogosExecutionZoneWalletModule::transfer_deshielded( return resultJson; } -std::string LogosExecutionZoneWalletModule::transfer_private( +std::string LEZCoreModule::transfer_private( const std::string& from_hex, const std::string& to_keys_json, const std::string& amount_le16_hex @@ -717,7 +717,7 @@ std::string LogosExecutionZoneWalletModule::transfer_private( return resultJson; } -std::string LogosExecutionZoneWalletModule::transfer_shielded_owned( +std::string LEZCoreModule::transfer_shielded_owned( const std::string& from_hex, const std::string& to_hex, const std::string& amount_le16_hex @@ -748,7 +748,7 @@ std::string LogosExecutionZoneWalletModule::transfer_shielded_owned( return resultJson; } -std::string LogosExecutionZoneWalletModule::transfer_private_owned( +std::string LEZCoreModule::transfer_private_owned( const std::string& from_hex, const std::string& to_hex, const std::string& amount_le16_hex @@ -776,7 +776,7 @@ std::string LogosExecutionZoneWalletModule::transfer_private_owned( return resultJson; } -std::string LogosExecutionZoneWalletModule::register_public_account(const std::string& account_id_hex) { +std::string LEZCoreModule::register_public_account(const std::string& account_id_hex) { FfiBytes32 id{}; if (!hexToBytes32(account_id_hex, &id)) { fprintf(stderr, "register_public_account: invalid account_id_hex\n"); @@ -795,7 +795,7 @@ std::string LogosExecutionZoneWalletModule::register_public_account(const std::s // === Bridge (L1 Bedrock <-> L2) === -std::string LogosExecutionZoneWalletModule::bridge_withdraw( +std::string LEZCoreModule::bridge_withdraw( const std::string& from_hex, const std::string& bedrock_account_pk_hex, const uint64_t amount @@ -820,7 +820,7 @@ std::string LogosExecutionZoneWalletModule::bridge_withdraw( // === Vault claiming === -std::string LogosExecutionZoneWalletModule::get_vault_balance(const std::string& owner_account_id_hex) { +std::string LEZCoreModule::get_vault_balance(const std::string& owner_account_id_hex) { FfiBytes32 ownerId{}; if (!hexToBytes32(owner_account_id_hex, &ownerId)) { fprintf(stderr, "get_vault_balance: invalid owner_account_id_hex\n"); @@ -836,7 +836,7 @@ std::string LogosExecutionZoneWalletModule::get_vault_balance(const std::string& return balanceLe16ToDecimalString(balance); } -std::string LogosExecutionZoneWalletModule::vault_claim( +std::string LEZCoreModule::vault_claim( const std::string& owner_account_id_hex, const std::string& amount_le16_hex ) { @@ -863,7 +863,7 @@ std::string LogosExecutionZoneWalletModule::vault_claim( return resultJson; } -std::string LogosExecutionZoneWalletModule::vault_claim_private( +std::string LEZCoreModule::vault_claim_private( const std::string& owner_account_id_hex, const std::string& amount_le16_hex ) { @@ -890,7 +890,7 @@ std::string LogosExecutionZoneWalletModule::vault_claim_private( return resultJson; } -std::string LogosExecutionZoneWalletModule::register_private_account(const std::string& account_id_hex) { +std::string LEZCoreModule::register_private_account(const std::string& account_id_hex) { FfiBytes32 id{}; if (!hexToBytes32(account_id_hex, &id)) { fprintf(stderr, "register_private_account: invalid account_id_hex\n"); @@ -907,7 +907,7 @@ std::string LogosExecutionZoneWalletModule::register_private_account(const std:: return resultJson; } -std::vector LogosExecutionZoneWalletModule::token_elf() { +std::vector LEZCoreModule::token_elf() { FfiProgram ffi_program{}; WalletFfiError error = wallet_ffi_token_elf(&ffi_program); if (error != SUCCESS) { @@ -922,7 +922,7 @@ std::vector LogosExecutionZoneWalletModule::token_elf() { return result; } -std::vector LogosExecutionZoneWalletModule::amm_elf() { +std::vector LEZCoreModule::amm_elf() { FfiProgram ffi_program{}; WalletFfiError error = wallet_ffi_token_elf(&ffi_program); if (error != SUCCESS) { @@ -937,7 +937,7 @@ std::vector LogosExecutionZoneWalletModule::amm_elf() { return result; } -std::vector LogosExecutionZoneWalletModule::ata_elf() { +std::vector LEZCoreModule::ata_elf() { FfiProgram ffi_program{}; WalletFfiError error = wallet_ffi_token_elf(&ffi_program); if (error != SUCCESS) { @@ -952,7 +952,7 @@ std::vector LogosExecutionZoneWalletModule::ata_elf() { return result; } -std::vector LogosExecutionZoneWalletModule::authenticated_transfer_elf() { +std::vector LEZCoreModule::authenticated_transfer_elf() { FfiProgram ffi_program{}; WalletFfiError error = wallet_ffi_token_elf(&ffi_program); if (error != SUCCESS) { @@ -967,7 +967,7 @@ std::vector LogosExecutionZoneWalletModule::authenticated_transfer_elf( return result; } -std::string LogosExecutionZoneWalletModule::send_generic_public_transaction( +std::string LEZCoreModule::send_generic_public_transaction( const std::vector& account_ids, const std::vector& signing_requirements, const std::vector& instruction, @@ -1032,7 +1032,7 @@ std::string LogosExecutionZoneWalletModule::send_generic_public_transaction( return resultJson; } -std::string LogosExecutionZoneWalletModule::send_generic_private_transaction( +std::string LEZCoreModule::send_generic_private_transaction( const std::vector& account_ids, const std::vector& instruction, const std::vector& program_elf, @@ -1121,7 +1121,7 @@ std::string LogosExecutionZoneWalletModule::send_generic_private_transaction( return resultJson; } -std::string LogosExecutionZoneWalletModule::send_program_deployment_transaction( +std::string LEZCoreModule::send_program_deployment_transaction( const std::vector& program_elf ) { FfiTransactionResult result {}; @@ -1147,7 +1147,7 @@ std::string LogosExecutionZoneWalletModule::send_program_deployment_transaction( // === Wallet Lifecycle === -std::string LogosExecutionZoneWalletModule::create_new( +std::string LEZCoreModule::create_new( const std::string& config_path, const std::string& storage_path, const std::string& password @@ -1171,7 +1171,7 @@ std::string LogosExecutionZoneWalletModule::create_new( return mnemonic; } -int64_t LogosExecutionZoneWalletModule::restore_storage(const std::string& mnemonic, const std::string password, uint32_t depth) { +int64_t LEZCoreModule::restore_storage(const std::string& mnemonic, const std::string password, uint32_t depth) { const WalletFfiError error = wallet_ffi_restore_data(walletHandle, mnemonic.c_str(), password.c_str(), depth); if (error != SUCCESS) { fprintf(stderr, "restore_storage: wallet FFI error %d\n", error); @@ -1181,7 +1181,7 @@ int64_t LogosExecutionZoneWalletModule::restore_storage(const std::string& mnemo return SUCCESS; } -int64_t LogosExecutionZoneWalletModule::open(const std::string& config_path, const std::string& storage_path) { +int64_t LEZCoreModule::open(const std::string& config_path, const std::string& storage_path) { if (walletHandle) { fprintf(stderr, "open: wallet is already open\n"); return INTERNAL_ERROR; @@ -1196,13 +1196,13 @@ int64_t LogosExecutionZoneWalletModule::open(const std::string& config_path, con return SUCCESS; } -int64_t LogosExecutionZoneWalletModule::save() { +int64_t LEZCoreModule::save() { return wallet_ffi_save(walletHandle); } // === Configuration === -std::string LogosExecutionZoneWalletModule::get_sequencer_addr() { +std::string LEZCoreModule::get_sequencer_addr() { char* addr = wallet_ffi_get_sequencer_addr(walletHandle); if (!addr) { fprintf(stderr, "get_sequencer_addr: wallet_ffi returned null\n"); diff --git a/src/logos_execution_zone_wallet_module.h b/src/lez_core_module.h similarity index 83% rename from src/logos_execution_zone_wallet_module.h rename to src/lez_core_module.h index 0a05bd8..4c82286 100644 --- a/src/logos_execution_zone_wallet_module.h +++ b/src/lez_core_module.h @@ -1,5 +1,5 @@ -#ifndef LOGOS_EXECUTION_ZONE_WALLET_MODULE_H -#define LOGOS_EXECUTION_ZONE_WALLET_MODULE_H +#ifndef LEZ_CORE_MODULE_H +#define LEZ_CORE_MODULE_H #include #include @@ -10,7 +10,7 @@ extern "C" { #include } -// Universal (Qt-free) execution-zone wallet module. The Qt glue (provider +// Universal (Qt-free) execution-zone core module. The Qt glue (provider // object + plugin) is generated from this header by logos-cpp-generator, which // maps the std return types below to the Qt signatures callers invoke: // std::string -> QString, int64_t -> int, LogosList -> QVariantList. @@ -18,13 +18,13 @@ extern "C" { // NOTE: the generator parses this header line-by-line and only recognises a // method when its declaration ends with ';' on a single line. Keep every // method declaration on ONE line โ€” multi-line signatures are silently dropped. -class LogosExecutionZoneWalletModule { +class LEZCoreModule { public: - LogosExecutionZoneWalletModule(); - ~LogosExecutionZoneWalletModule(); + LEZCoreModule(); + ~LEZCoreModule(); - LogosExecutionZoneWalletModule(const LogosExecutionZoneWalletModule&) = delete; - LogosExecutionZoneWalletModule& operator=(const LogosExecutionZoneWalletModule&) = delete; + LEZCoreModule(const LEZCoreModule&) = delete; + LEZCoreModule& operator=(const LEZCoreModule&) = delete; std::string name() const; std::string version() const; @@ -78,15 +78,8 @@ public: std::vector ata_elf(); std::string send_generic_public_transaction(const std::vector& account_ids, const std::vector& signing_requirements, const std::vector& instruction, const std::string& program_id_hex); - std::string send_generic_private_transaction( - const std::vector& account_ids, - const std::vector& instruction, - const std::vector& program_elf, - const std::vector>& program_dependencies - ); - std::string send_program_deployment_transaction( - const std::vector& program_elf - ); + std::string send_generic_private_transaction(const std::vector& account_ids, const std::vector& instruction, const std::vector& program_elf, const std::vector>& program_dependencies); + std::string send_program_deployment_transaction(const std::vector& program_elf); // === Bridge (L1 Bedrock <-> L2) === std::string bridge_withdraw(const std::string& from_hex, const std::string& bedrock_account_pk_hex, uint64_t amount); @@ -103,4 +96,4 @@ private: WalletHandle* walletHandle = nullptr; }; -#endif // LOGOS_EXECUTION_ZONE_WALLET_MODULE_H +#endif // LEZ_CORE_MODULE_H From fb762f8bc0d142de0c105b50b67d08b9b6076f8d Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Tue, 30 Jun 2026 13:43:51 +0300 Subject: [PATCH 2/5] fix: tests fix --- tests/CMakeLists.txt | 24 ++-- ...t_execution_zone.cpp => test_lez_core.cpp} | 118 +++++++++--------- ...tion.cpp => test_lez_core_integration.cpp} | 8 +- 3 files changed, 75 insertions(+), 75 deletions(-) rename tests/{test_execution_zone.cpp => test_lez_core.cpp} (90%) rename tests/{test_execution_zone_integration.cpp => test_lez_core_integration.cpp} (83%) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 02c85ff..e08bdf5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,17 +1,17 @@ cmake_minimum_required(VERSION 3.14) -project(ExecutionZoneModuleTests LANGUAGES CXX) +project(LEZCoreTests LANGUAGES CXX) include(LogosTest) # Unit tests (mocked wallet_ffi) logos_test( - NAME execution_zone_module_tests + NAME lez_core_module_tests MODULE_SOURCES - ../src/logos_execution_zone_wallet_module.cpp + ../src/lez_core_module.cpp TEST_SOURCES main.cpp - test_execution_zone.cpp + test_lez_core.cpp MOCK_C_SOURCES mocks/mock_wallet_ffi.cpp EXTRA_INCLUDES @@ -19,7 +19,7 @@ logos_test( ) # The module targets C++20 (uses __uint128_t); LogosTest.cmake defaults to C++17. -set_target_properties(execution_zone_module_tests PROPERTIES CXX_STANDARD 20) +set_target_properties(lez_core_module_tests PROPERTIES CXX_STANDARD 20) # Integration tests (real wallet_ffi library) @@ -29,27 +29,27 @@ find_library(WALLET_FFI_PATH NO_DEFAULT_PATH) if(WALLET_FFI_PATH) - message(STATUS "[ExecutionZoneTests] wallet_ffi found: ${WALLET_FFI_PATH} - building integration tests") + message(STATUS "[LEZCoreTests] wallet_ffi found: ${WALLET_FFI_PATH} - building integration tests") logos_test( - NAME execution_zone_module_integration_tests + NAME lez_core_module_integration_tests MODULE_SOURCES - ../src/logos_execution_zone_wallet_module.cpp + ../src/lez_core_module.cpp TEST_SOURCES main.cpp - test_execution_zone_integration.cpp + test_lez_core_integration.cpp EXTRA_INCLUDES ../lib EXTRA_LINK_LIBS ${WALLET_FFI_PATH} ) - set_target_properties(execution_zone_module_integration_tests PROPERTIES CXX_STANDARD 20) + set_target_properties(lez_core_module_integration_tests PROPERTIES CXX_STANDARD 20) get_filename_component(WALLET_FFI_DIR "${WALLET_FFI_PATH}" DIRECTORY) - set_target_properties(execution_zone_module_integration_tests PROPERTIES + set_target_properties(lez_core_module_integration_tests PROPERTIES BUILD_RPATH "${WALLET_FFI_DIR}" ) else() - message(STATUS "[ExecutionZoneTests] wallet_ffi not found in ../lib - skipping integration tests") + message(STATUS "[LEZCoreTests] wallet_ffi not found in ../lib - skipping integration tests") endif() diff --git a/tests/test_execution_zone.cpp b/tests/test_lez_core.cpp similarity index 90% rename from tests/test_execution_zone.cpp rename to tests/test_lez_core.cpp index c8e816b..a463d39 100644 --- a/tests/test_execution_zone.cpp +++ b/tests/test_lez_core.cpp @@ -1,8 +1,8 @@ -// Unit tests for LogosExecutionZoneWalletModule. +// Unit tests for LEZCoreModule. // All wallet_ffi C functions are mocked at link time via mock_wallet_ffi.cpp. #include -#include "logos_execution_zone_wallet_module.h" +#include "lez_core_module.h" #include "mocks/mock_wallet_ffi_capture.h" #include @@ -27,7 +27,7 @@ static nlohmann::json parseObject(const std::string& json) { // ============================================================================ LOGOS_TEST(name_and_version) { - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_EQ(module.name(), std::string("logos_execution_zone")); LOGOS_ASSERT_EQ(module.version(), std::string("1.0.0")); } @@ -38,7 +38,7 @@ LOGOS_TEST(name_and_version) { LOGOS_TEST(create_account_public_returns_hex_on_success) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const std::string id = module.create_account_public(); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_create_account_public")); @@ -51,14 +51,14 @@ LOGOS_TEST(create_account_public_returns_hex_on_success) { LOGOS_TEST(create_account_public_returns_empty_on_error) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_create_account_public").returns(static_cast(INTERNAL_ERROR)); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_TRUE(module.create_account_public().empty()); } LOGOS_TEST(create_account_private_returns_hex_on_success) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const std::string id = module.create_account_private(); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_create_account_private")); @@ -70,7 +70,7 @@ LOGOS_TEST(create_account_private_returns_hex_on_success) { LOGOS_TEST(list_accounts_maps_entries) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("list_accounts_count").returns(3); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const LogosList accounts = module.list_accounts(); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_list_accounts")); @@ -87,7 +87,7 @@ LOGOS_TEST(list_accounts_maps_entries) { LOGOS_TEST(list_accounts_empty_on_error) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_list_accounts").returns(static_cast(INTERNAL_ERROR)); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_EQ(static_cast(module.list_accounts().size()), 0); } @@ -98,7 +98,7 @@ LOGOS_TEST(list_accounts_empty_on_error) { LOGOS_TEST(get_balance_invalid_hex_returns_empty) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_TRUE(module.get_balance("not-hex", true).empty()); LOGOS_ASSERT_FALSE(t.cFunctionCalled("wallet_ffi_get_balance")); @@ -107,7 +107,7 @@ LOGOS_TEST(get_balance_invalid_hex_returns_empty) { LOGOS_TEST(get_balance_returns_decimal_string) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("get_balance_value").returns(123456789); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const std::string balance = module.get_balance(VALID_ID, true); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_get_balance")); @@ -117,14 +117,14 @@ LOGOS_TEST(get_balance_returns_decimal_string) { LOGOS_TEST(get_balance_zero) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("get_balance_value").returns(0); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_EQ(module.get_balance(VALID_ID, false), std::string("0")); } LOGOS_TEST(get_account_public_returns_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.get_account_public(VALID_ID)); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_get_account_public")); @@ -136,7 +136,7 @@ LOGOS_TEST(get_account_public_returns_json) { LOGOS_TEST(get_account_public_invalid_hex_returns_empty) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_TRUE(module.get_account_public("zz").empty()); LOGOS_ASSERT_FALSE(t.cFunctionCalled("wallet_ffi_get_account_public")); @@ -144,7 +144,7 @@ LOGOS_TEST(get_account_public_invalid_hex_returns_empty) { LOGOS_TEST(get_public_account_key_returns_hex) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; std::string expected; for (int i = 0; i < 32; ++i) expected += "be"; @@ -153,7 +153,7 @@ LOGOS_TEST(get_public_account_key_returns_hex) { LOGOS_TEST(get_private_account_keys_returns_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.get_private_account_keys(VALID_ID)); std::string expected; @@ -167,7 +167,7 @@ LOGOS_TEST(get_private_account_keys_returns_json) { LOGOS_TEST(account_id_to_base58_invalid_hex_returns_empty) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_TRUE(module.account_id_to_base58("xyz").empty()); } @@ -175,14 +175,14 @@ LOGOS_TEST(account_id_to_base58_invalid_hex_returns_empty) { LOGOS_TEST(account_id_to_base58_returns_string) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_account_id_to_base58").returns("SomeBase58Value"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_EQ(module.account_id_to_base58(VALID_ID), std::string("SomeBase58Value")); } LOGOS_TEST(account_id_from_base58_returns_hex) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; std::string expected; for (int i = 0; i < 32; ++i) expected += "5a"; @@ -192,7 +192,7 @@ LOGOS_TEST(account_id_from_base58_returns_hex) { LOGOS_TEST(account_id_from_base58_error_returns_empty) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_account_id_from_base58").returns(static_cast(INTERNAL_ERROR)); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_TRUE(module.account_id_from_base58("anything").empty()); } @@ -204,7 +204,7 @@ LOGOS_TEST(account_id_from_base58_error_returns_empty) { LOGOS_TEST(sync_to_block_forwards_value) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_sync_to_block").returns(7); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_EQ(module.sync_to_block(100), static_cast(7)); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_sync_to_block")); @@ -213,7 +213,7 @@ LOGOS_TEST(sync_to_block_forwards_value) { LOGOS_TEST(get_last_synced_block_returns_value) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("last_synced_block_value").returns(55); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_EQ(module.get_last_synced_block(), static_cast(55)); } @@ -221,7 +221,7 @@ LOGOS_TEST(get_last_synced_block_returns_value) { LOGOS_TEST(get_last_synced_block_error_returns_zero) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_get_last_synced_block").returns(static_cast(INTERNAL_ERROR)); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_EQ(module.get_last_synced_block(), static_cast(0)); } @@ -229,7 +229,7 @@ LOGOS_TEST(get_last_synced_block_error_returns_zero) { LOGOS_TEST(get_current_block_height_returns_value) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("current_block_height_value").returns(999); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_EQ(module.get_current_block_height(), static_cast(999)); } @@ -240,7 +240,7 @@ LOGOS_TEST(get_current_block_height_returns_value) { LOGOS_TEST(transfer_public_success_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.transfer_public(VALID_ID, VALID_ID_2, VALID_U128)); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_transfer_public")); @@ -251,7 +251,7 @@ LOGOS_TEST(transfer_public_success_json) { LOGOS_TEST(transfer_public_invalid_hex_error_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.transfer_public("bad", VALID_ID_2, VALID_U128)); LOGOS_ASSERT_FALSE(obj["success"].get()); @@ -261,7 +261,7 @@ LOGOS_TEST(transfer_public_invalid_hex_error_json) { LOGOS_TEST(transfer_public_invalid_amount_error_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.transfer_public(VALID_ID, VALID_ID_2, "ff")); LOGOS_ASSERT_FALSE(obj["success"].get()); @@ -271,7 +271,7 @@ LOGOS_TEST(transfer_public_invalid_amount_error_json) { LOGOS_TEST(transfer_public_ffi_error_json) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_transfer_public").returns(static_cast(INTERNAL_ERROR)); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.transfer_public(VALID_ID, VALID_ID_2, VALID_U128)); LOGOS_ASSERT_FALSE(obj["success"].get()); @@ -280,7 +280,7 @@ LOGOS_TEST(transfer_public_ffi_error_json) { LOGOS_TEST(transfer_shielded_invalid_keys_json_error) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; // to_keys_json is not valid JSON object -> parse failure. const nlohmann::json obj = parseObject(module.transfer_shielded(VALID_ID, "not-json", VALID_U128)); @@ -290,7 +290,7 @@ LOGOS_TEST(transfer_shielded_invalid_keys_json_error) { LOGOS_TEST(transfer_shielded_success_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const std::string keysJson = std::string("{\"nullifier_public_key\":\"") + std::string(64, 'a') + std::string("\"}"); const nlohmann::json obj = parseObject(module.transfer_shielded(VALID_ID, keysJson, VALID_U128)); @@ -301,7 +301,7 @@ LOGOS_TEST(transfer_shielded_success_json) { // to_keys_json carrying an explicit "identifier" must be forwarded to the FFI call as-is. LOGOS_TEST(transfer_shielded_with_identifier_forwards_it_unchanged) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const std::string identifierHex(32, '7'); // 16 bytes of 0x77 const std::string keysJson = std::string("{\"nullifier_public_key\":\"") + std::string(64, 'a') @@ -319,7 +319,7 @@ LOGOS_TEST(transfer_shielded_with_identifier_forwards_it_unchanged) { // generated each call (regression guard against reintroducing the old hardcoded-zero identifier). LOGOS_TEST(transfer_shielded_without_identifier_uses_random_nonzero_identifier) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const std::string keysJson = std::string("{\"nullifier_public_key\":\"") + std::string(64, 'a') + "\"}"; @@ -338,7 +338,7 @@ LOGOS_TEST(transfer_shielded_without_identifier_uses_random_nonzero_identifier) // transfer_private mirrors transfer_shielded's identifier handling exactly (see above). LOGOS_TEST(transfer_private_with_identifier_forwards_it_unchanged) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const std::string identifierHex(32, '7'); // 16 bytes of 0x77 const std::string keysJson = std::string("{\"nullifier_public_key\":\"") + std::string(64, 'a') @@ -354,7 +354,7 @@ LOGOS_TEST(transfer_private_with_identifier_forwards_it_unchanged) { LOGOS_TEST(transfer_private_without_identifier_uses_random_nonzero_identifier) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const std::string keysJson = std::string("{\"nullifier_public_key\":\"") + std::string(64, 'a') + "\"}"; @@ -372,7 +372,7 @@ LOGOS_TEST(transfer_private_without_identifier_uses_random_nonzero_identifier) { LOGOS_TEST(register_public_account_invalid_hex_error_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.register_public_account("bad")); LOGOS_ASSERT_FALSE(obj["success"].get()); @@ -381,7 +381,7 @@ LOGOS_TEST(register_public_account_invalid_hex_error_json) { LOGOS_TEST(register_private_account_success_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.register_private_account(VALID_ID)); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_register_private_account")); @@ -394,7 +394,7 @@ LOGOS_TEST(register_private_account_success_json) { LOGOS_TEST(bridge_withdraw_success_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.bridge_withdraw(VALID_ID, VALID_ID_2, 100)); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_bridge_withdraw")); @@ -405,7 +405,7 @@ LOGOS_TEST(bridge_withdraw_success_json) { LOGOS_TEST(bridge_withdraw_invalid_hex_error_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.bridge_withdraw("bad", VALID_ID_2, 100)); LOGOS_ASSERT_FALSE(obj["success"].get()); @@ -416,7 +416,7 @@ LOGOS_TEST(bridge_withdraw_invalid_hex_error_json) { LOGOS_TEST(bridge_withdraw_ffi_error_json) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_bridge_withdraw").returns(static_cast(INTERNAL_ERROR)); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.bridge_withdraw(VALID_ID, VALID_ID_2, 100)); LOGOS_ASSERT_FALSE(obj["success"].get()); @@ -429,7 +429,7 @@ LOGOS_TEST(bridge_withdraw_ffi_error_json) { LOGOS_TEST(get_vault_balance_invalid_hex_returns_empty) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_TRUE(module.get_vault_balance("not-hex").empty()); LOGOS_ASSERT_FALSE(t.cFunctionCalled("wallet_ffi_get_vault_balance")); @@ -438,7 +438,7 @@ LOGOS_TEST(get_vault_balance_invalid_hex_returns_empty) { LOGOS_TEST(get_vault_balance_returns_decimal_string) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("get_vault_balance_value").returns(42); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const std::string balance = module.get_vault_balance(VALID_ID); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_get_vault_balance")); @@ -448,14 +448,14 @@ LOGOS_TEST(get_vault_balance_returns_decimal_string) { LOGOS_TEST(get_vault_balance_ffi_error_returns_empty) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_get_vault_balance").returns(static_cast(INTERNAL_ERROR)); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_TRUE(module.get_vault_balance(VALID_ID).empty()); } LOGOS_TEST(vault_claim_success_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.vault_claim(VALID_ID, VALID_U128)); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_vault_claim")); @@ -466,7 +466,7 @@ LOGOS_TEST(vault_claim_success_json) { LOGOS_TEST(vault_claim_invalid_hex_error_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.vault_claim("bad", VALID_U128)); LOGOS_ASSERT_FALSE(obj["success"].get()); @@ -476,7 +476,7 @@ LOGOS_TEST(vault_claim_invalid_hex_error_json) { LOGOS_TEST(vault_claim_invalid_amount_error_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.vault_claim(VALID_ID, "ff")); LOGOS_ASSERT_FALSE(obj["success"].get()); @@ -486,7 +486,7 @@ LOGOS_TEST(vault_claim_invalid_amount_error_json) { LOGOS_TEST(vault_claim_ffi_error_json) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_vault_claim").returns(static_cast(INTERNAL_ERROR)); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.vault_claim(VALID_ID, VALID_U128)); LOGOS_ASSERT_FALSE(obj["success"].get()); @@ -495,7 +495,7 @@ LOGOS_TEST(vault_claim_ffi_error_json) { LOGOS_TEST(vault_claim_private_success_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.vault_claim_private(VALID_ID, VALID_U128)); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_vault_claim_private")); @@ -504,7 +504,7 @@ LOGOS_TEST(vault_claim_private_success_json) { LOGOS_TEST(vault_claim_private_invalid_hex_error_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.vault_claim_private("bad", VALID_U128)); LOGOS_ASSERT_FALSE(obj["success"].get()); @@ -513,7 +513,7 @@ LOGOS_TEST(vault_claim_private_invalid_hex_error_json) { LOGOS_TEST(vault_claim_private_invalid_amount_error_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.vault_claim_private(VALID_ID, "ff")); LOGOS_ASSERT_FALSE(obj["success"].get()); @@ -523,7 +523,7 @@ LOGOS_TEST(vault_claim_private_invalid_amount_error_json) { LOGOS_TEST(vault_claim_private_ffi_error_json) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_vault_claim_private").returns(static_cast(INTERNAL_ERROR)); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.vault_claim_private(VALID_ID, VALID_U128)); LOGOS_ASSERT_FALSE(obj["success"].get()); @@ -536,7 +536,7 @@ LOGOS_TEST(vault_claim_private_ffi_error_json) { LOGOS_TEST(claim_pinata_invalid_hex_returns_empty) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_TRUE(module.claim_pinata("bad", VALID_ID_2, VALID_U128).empty()); LOGOS_ASSERT_FALSE(t.cFunctionCalled("wallet_ffi_claim_pinata")); @@ -544,7 +544,7 @@ LOGOS_TEST(claim_pinata_invalid_hex_returns_empty) { LOGOS_TEST(claim_pinata_invalid_solution_returns_empty) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_TRUE(module.claim_pinata(VALID_ID, VALID_ID_2, "ab").empty()); LOGOS_ASSERT_FALSE(t.cFunctionCalled("wallet_ffi_claim_pinata")); @@ -552,7 +552,7 @@ LOGOS_TEST(claim_pinata_invalid_solution_returns_empty) { LOGOS_TEST(claim_pinata_success_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const nlohmann::json obj = parseObject(module.claim_pinata(VALID_ID, VALID_ID_2, VALID_U128)); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_claim_pinata")); @@ -561,7 +561,7 @@ LOGOS_TEST(claim_pinata_success_json) { LOGOS_TEST(claim_pinata_already_initialized_invalid_siblings_returns_empty) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; // siblings json is not an array -> parse failure. const std::string result = module.claim_pinata_private_owned_already_initialized( @@ -572,7 +572,7 @@ LOGOS_TEST(claim_pinata_already_initialized_invalid_siblings_returns_empty) { LOGOS_TEST(claim_pinata_already_initialized_success_json) { auto t = LogosTestContext("logos_execution_zone"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const std::string siblings = std::string("[\"") + std::string(64, 'a') + std::string("\",\"") + std::string(64, 'b') + std::string("\"]"); const nlohmann::json obj = parseObject(module.claim_pinata_private_owned_already_initialized( @@ -588,7 +588,7 @@ LOGOS_TEST(claim_pinata_already_initialized_success_json) { LOGOS_TEST(create_new_success_then_double_open_fails) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_create_new").returns(1); // non-null handle - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_TRUE(!module.create_new("/cfg", "/store", "pw").empty()); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_create_new")); @@ -599,7 +599,7 @@ LOGOS_TEST(create_new_success_then_double_open_fails) { LOGOS_TEST(create_new_null_handle_returns_internal_error) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_create_new").returns(0); // null handle - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_EQ(module.create_new("/cfg", "/store", "pw"), ""); } @@ -607,7 +607,7 @@ LOGOS_TEST(create_new_null_handle_returns_internal_error) { LOGOS_TEST(open_success) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_open").returns(1); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_EQ(module.open("/cfg", "/store"), static_cast(SUCCESS)); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_open")); @@ -616,7 +616,7 @@ LOGOS_TEST(open_success) { LOGOS_TEST(save_forwards_return_code) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_save").returns(static_cast(SUCCESS)); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_EQ(module.save(), static_cast(SUCCESS)); LOGOS_ASSERT(t.cFunctionCalled("wallet_ffi_save")); @@ -629,7 +629,7 @@ LOGOS_TEST(save_forwards_return_code) { LOGOS_TEST(get_sequencer_addr_returns_string) { auto t = LogosTestContext("logos_execution_zone"); t.mockCFunction("wallet_ffi_get_sequencer_addr").returns("10.0.0.1:9000"); - LogosExecutionZoneWalletModule module; + LEZCoreModule module; LOGOS_ASSERT_EQ(module.get_sequencer_addr(), std::string("10.0.0.1:9000")); } diff --git a/tests/test_execution_zone_integration.cpp b/tests/test_lez_core_integration.cpp similarity index 83% rename from tests/test_execution_zone_integration.cpp rename to tests/test_lez_core_integration.cpp index 861a2ed..dee21a1 100644 --- a/tests/test_execution_zone_integration.cpp +++ b/tests/test_lez_core_integration.cpp @@ -1,4 +1,4 @@ -// Integration tests for LogosExecutionZoneWalletModule โ€” uses the REAL wallet_ffi +// Integration tests for LEZCoreModule โ€” uses the REAL wallet_ffi // library. No mocking. Limited to network-free, wallet-handle-free pure functions // so the suite stays deterministic and offline. // @@ -6,14 +6,14 @@ // time. Skipped automatically when the library is not found (see CMakeLists.txt). #include -#include "logos_execution_zone_wallet_module.h" +#include "lez_core_module.h" #include // account_id_to_base58 and account_id_from_base58 are pure encoding helpers that // do not require an open wallet, so they can be exercised against the real lib. LOGOS_TEST(integration_account_id_base58_round_trip) { - LogosExecutionZoneWalletModule module; + LEZCoreModule module; const std::string idHex = std::string(64, 'a'); @@ -26,7 +26,7 @@ LOGOS_TEST(integration_account_id_base58_round_trip) { } LOGOS_TEST(integration_account_id_from_base58_rejects_garbage) { - LogosExecutionZoneWalletModule module; + LEZCoreModule module; // Clearly invalid base58 input should not decode to a valid id. LOGOS_ASSERT_TRUE(module.account_id_from_base58("!!!not-base58!!!").empty()); From 94b512cc140611c8562682bcecdff7afc02187bd Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Tue, 30 Jun 2026 15:08:35 +0300 Subject: [PATCH 3/5] fix: added pull template --- .github/pull_request_template.md | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..18064c6 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,43 @@ +## ๐ŸŽฏ Purpose + +*What problem does this PR solve or what feature does it add? Mention issues related to it* + +TO COMPLETE + +## โš™๏ธ Approach + +*Describe the core changes introduced by this PR.* + +TO COMPLETE + +- [ ] Change ... +- [ ] Add ... +- [ ] Fix ... +- [ ] ... + +## ๐Ÿงช How to Test + +*How to verify that this PR works as intended.* + +TO COMPLETE + +## ๐Ÿ”— Dependencies + +*Link PRs that must be merged before this one.* + +TO COMPLETE IF APPLICABLE + +## ๐Ÿ”œ Future Work + +*List any work intentionally left out of this PR, whether due to scope, prioritization, or pending decisions.* + +TO COMPLETE IF APPLICABLE + +## ๐Ÿ“‹ PR Completion Checklist + +*Mark only completed items. A complete PR should have all boxes ticked.* + +- [ ] Complete PR description +- [ ] Implement the core functionality +- [ ] Add/update tests +- [ ] Add/update documentation and inline comments From 9188b154d6e015f961b173b89427ab7e7e1571ba Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Tue, 30 Jun 2026 16:13:02 +0300 Subject: [PATCH 4/5] fix: test fix --- tests/test_lez_core.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_lez_core.cpp b/tests/test_lez_core.cpp index a463d39..de812db 100644 --- a/tests/test_lez_core.cpp +++ b/tests/test_lez_core.cpp @@ -28,8 +28,8 @@ static nlohmann::json parseObject(const std::string& json) { LOGOS_TEST(name_and_version) { LEZCoreModule module; - LOGOS_ASSERT_EQ(module.name(), std::string("logos_execution_zone")); - LOGOS_ASSERT_EQ(module.version(), std::string("1.0.0")); + LOGOS_ASSERT_EQ(module.name(), std::string("lez_core")); + LOGOS_ASSERT_EQ(module.version(), std::string("0.2.0")); } // ============================================================================ From 1d4db06ebcdd4879a4395efbe4993a15992a261b Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Tue, 30 Jun 2026 18:18:47 +0300 Subject: [PATCH 5/5] fix: try fix doctest --- .../logos-execution-zone-runtime.test.yaml | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/doctests/logos-execution-zone-runtime.test.yaml b/doctests/logos-execution-zone-runtime.test.yaml index 2b55e5b..7be19af 100644 --- a/doctests/logos-execution-zone-runtime.test.yaml +++ b/doctests/logos-execution-zone-runtime.test.yaml @@ -138,8 +138,8 @@ sections: text: "Scan the directory and confirm the module landed:" run: "./lgpm/bin/lgpm --modules-dir ./modules list" expect_contains: - - "logos_execution_zone" - check_file: "modules/logos_execution_zone/manifest.json" + - "lez_core" + check_file: "modules/lez_core/manifest.json" - title: "Run the daemon and call the module" step: true @@ -170,18 +170,18 @@ sections: code_block: "logoscore status" - title: "List discovered modules" - text: "`logos_execution_zone` should be visible in the scan directory:" + text: "`lez_core` should be visible in the scan directory:" run: "./logos/bin/logoscore list-modules" code_block: "logoscore list-modules" expect_contains: - - "logos_execution_zone" + - "lez_core" - title: "Load the module" - text: "Load `logos_execution_zone` into the running daemon:" - run: "./logos/bin/logoscore load-module logos_execution_zone" - code_block: "logoscore load-module logos_execution_zone" + text: "Load `lez_core` into the running daemon:" + run: "./logos/bin/logoscore load-module lez_core" + code_block: "logoscore load-module lez_core" expect_contains: - - "logos_execution_zone" + - "lez_core" - title: "Confirm the module is loaded" text: | @@ -190,17 +190,17 @@ sections: run: "./logos/bin/logoscore status" code_block: "logoscore status" expect_contains: - - "logos_execution_zone" + - "lez_core" - '"status":"loaded"' - title: "Introspect the module with module-info" text: | `module-info` lists the methods the module exposes โ€” the same methods you can `call`: - run: "./logos/bin/logoscore module-info logos_execution_zone" - code_block: "logoscore module-info logos_execution_zone" + run: "./logos/bin/logoscore module-info lez_core" + code_block: "logoscore module-info lez_core" expect_contains: - - "logos_execution_zone" + - "lez_core" - "account_id_to_base58" - "account_id_from_base58" @@ -208,19 +208,19 @@ sections: text: | `name` returns the module's own identifier โ€” the simplest possible round-trip through the loaded plugin over liblogos' IPC: - run: "./logos/bin/logoscore call logos_execution_zone name" - code_block: "logoscore call logos_execution_zone name" + run: "./logos/bin/logoscore call lez_core name" + code_block: "logoscore call lez_core name" expect_contains: - - '"result":"logos_execution_zone"' + - '"result":"lez_core"' - title: "Read the module version" text: | - `version` returns the module's semantic version (`1.0.0`), matching + `version` returns the module's semantic version (`0.2.0`), matching `metadata.json`: - run: "./logos/bin/logoscore call logos_execution_zone version" - code_block: "logoscore call logos_execution_zone version" + run: "./logos/bin/logoscore call lez_core version" + code_block: "logoscore call lez_core version" expect_contains: - - '"result":"1.0.0"' + - '"result":"0.2.0"' - title: "Encode an account id to base58" text: | @@ -228,8 +228,8 @@ sections: and returns its base58 form. This is a pure encoding helper in `wallet_ffi` โ€” no open wallet and no network required, so it runs entirely offline: - run: "./logos/bin/logoscore call logos_execution_zone account_id_to_base58 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - code_block: "logoscore call logos_execution_zone account_id_to_base58 aaaaaaaa...aaaa # 64 hex chars" + run: "./logos/bin/logoscore call lez_core account_id_to_base58 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + code_block: "logoscore call lez_core account_id_to_base58 aaaaaaaa...aaaa # 64 hex chars" expect_contains: - '"result"' @@ -240,14 +240,14 @@ sections: decoding the same id and recovering the input is a deterministic, end-to-end proof that the codec โ€” and the IPC path to this module โ€” work: run: | - ENC=$(./logos/bin/logoscore call logos_execution_zone account_id_to_base58 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) + ENC=$(./logos/bin/logoscore call lez_core account_id_to_base58 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) B58=$(printf '%s' "$ENC" | sed -n 's/.*"result":"\([^"]*\)".*/\1/p') echo "encoded: $B58" - ./logos/bin/logoscore call logos_execution_zone account_id_from_base58 "$B58" + ./logos/bin/logoscore call lez_core account_id_from_base58 "$B58" code_block: | # Encode, then decode the result back โ€” the round-trip returns the input. - B58=$(logoscore call logos_execution_zone account_id_to_base58 aaaa...aaaa) - logoscore call logos_execution_zone account_id_from_base58 "$B58" + B58=$(logoscore call lez_core account_id_to_base58 aaaa...aaaa) + logoscore call lez_core account_id_from_base58 "$B58" expect_contains: - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" @@ -255,8 +255,8 @@ sections: text: | Decoding obvious garbage fails cleanly: `account_id_from_base58` returns an empty result rather than crashing the module or the daemon: - run: "./logos/bin/logoscore call logos_execution_zone account_id_from_base58 '!!!not-base58!!!'" - code_block: "logoscore call logos_execution_zone account_id_from_base58 '!!!not-base58!!!'" + run: "./logos/bin/logoscore call lez_core account_id_from_base58 '!!!not-base58!!!'" + code_block: "logoscore call lez_core account_id_from_base58 '!!!not-base58!!!'" expect_contains: - '"result":""'