From 9ad5e83615cabf5f88efa9cde3f94185498e9b5a Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Fri, 5 Jun 2026 18:38:14 +0300 Subject: [PATCH] fix(nix): builds fixed --- flake.lock | 8 +-- flake.nix | 2 +- src/i_logos_execution_zone_wallet_module.h | 6 +-- src/logos_execution_zone_wallet_module.cpp | 59 ++++++++++++---------- src/logos_execution_zone_wallet_module.h | 6 +-- 5 files changed, 44 insertions(+), 37 deletions(-) diff --git a/flake.lock b/flake.lock index 8399167..70da078 100644 --- a/flake.lock +++ b/flake.lock @@ -891,17 +891,17 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1780669896, - "narHash": "sha256-EfR9yD9Vz8nl639ZZGb/rjp8PJJhbC4NTVorshmQAxk=", + "lastModified": 1780670706, + "narHash": "sha256-ST5KExyHCZidz6QnMa3jd1S9qQJnnQm0q2agdEzHXXc=", "owner": "logos-blockchain", "repo": "lssa", - "rev": "8a4a6cd12a43adc0f7379c5866c89b400200408d", + "rev": "c37a3c30a96515cba756174da1da4137ff025d7f", "type": "github" }, "original": { "owner": "logos-blockchain", "repo": "lssa", - "rev": "8a4a6cd12a43adc0f7379c5866c89b400200408d", + "rev": "c37a3c30a96515cba756174da1da4137ff025d7f", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 4253e75..2eb2a1d 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ inputs = { logos-module-builder.url = "github:logos-co/logos-module-builder"; nix-bundle-lgx.url = "github:logos-co/nix-bundle-lgx"; - logos-execution-zone.url = "github:logos-blockchain/lssa?rev=8a4a6cd12a43adc0f7379c5866c89b400200408d"; # branch with the latest functionality + logos-execution-zone.url = "github:logos-blockchain/lssa?rev=c37a3c30a96515cba756174da1da4137ff025d7f"; # branch with the latest functionality }; outputs = inputs@{ logos-module-builder, ... }: diff --git a/src/i_logos_execution_zone_wallet_module.h b/src/i_logos_execution_zone_wallet_module.h index 4a05b77..ac89610 100644 --- a/src/i_logos_execution_zone_wallet_module.h +++ b/src/i_logos_execution_zone_wallet_module.h @@ -100,16 +100,16 @@ public: const QList& signing_requirements, const QList& instruction, const QList& program_elf, - const QList>& program_dependencies, + const QList>& program_dependencies ) = 0; virtual QString send_generic_private_transaction( const QList& account_ids, const QList& instruction, const QList& program_elf, - const QList>& program_dependencies, + const QList>& program_dependencies ) = 0; virtual QString send_program_deployment_transaction( - const QList& program_elf, + const QList& program_elf ) = 0; // Wallet Lifecycle diff --git a/src/logos_execution_zone_wallet_module.cpp b/src/logos_execution_zone_wallet_module.cpp index 26129fc..8baa34f 100644 --- a/src/logos_execution_zone_wallet_module.cpp +++ b/src/logos_execution_zone_wallet_module.cpp @@ -46,6 +46,7 @@ static constexpr auto NullifierPublicKey = "nullifier_public_key"; static constexpr auto ViewingPublicKey = "viewing_public_key"; static constexpr auto AccountId = "account_id"; static constexpr auto IsPublic = "is_public"; +static constexpr auto Secrets = "secrets"; } // namespace JsonKeys static bool hexToBytes(const QString& hex, QByteArray& output_bytes, int expectedLength = -1) { @@ -577,8 +578,11 @@ QString LogosExecutionZoneWalletModule::transfer_shielded( return transferResultToJson(nullptr, QStringLiteral("transfer_shielded: amount_le16_hex must be 32 hex characters (16 bytes)")); } + // Bandaid, I am not sure, how exactly identifiers should be used. + FfiU128 identifier {}; + FfiTransferResult result{}; - const WalletFfiError error = wallet_ffi_transfer_shielded(walletHandle, &fromId, &toKeys, &amount, &result); + const WalletFfiError error = wallet_ffi_transfer_shielded(walletHandle, &fromId, &toKeys, &identifier, &amount, &result); free(const_cast(toKeys.viewing_public_key)); if (error != SUCCESS) { qWarning() << "transfer_shielded: wallet FFI error" << error; @@ -641,8 +645,11 @@ QString LogosExecutionZoneWalletModule::transfer_private( return transferResultToJson(nullptr, QStringLiteral("transfer_private: amount_le16_hex must be 32 hex characters (16 bytes)")); } + // Bandaid, I am not sure, how exactly identifiers should be used. + FfiU128 identifier {}; + FfiTransferResult result{}; - const WalletFfiError error = wallet_ffi_transfer_private(walletHandle, &fromId, &toKeys, &amount, &result); + const WalletFfiError error = wallet_ffi_transfer_private(walletHandle, &fromId, &toKeys, &identifier, &amount, &result); free(const_cast(toKeys.viewing_public_key)); if (error != SUCCESS) { qWarning() << "transfer_private: wallet FFI error" << error; @@ -764,7 +771,7 @@ QList LogosExecutionZoneWalletModule::token_elf() { return QList {}; } - QList result(ffi_program.elf_data, ffi_program.elf_data + raw_words.elf_size); + QList result(ffi_program.elf_data, ffi_program.elf_data + ffi_program.elf_size); wallet_ffi_free_ffi_program(&ffi_program); return result; } @@ -777,7 +784,7 @@ QList LogosExecutionZoneWalletModule::amm_elf() { return QList {}; } - QList result(ffi_program.elf_data, ffi_program.elf_data + raw_words.elf_size); + QList result(ffi_program.elf_data, ffi_program.elf_data + ffi_program.elf_size); wallet_ffi_free_ffi_program(&ffi_program); return result; } @@ -790,7 +797,7 @@ QList LogosExecutionZoneWalletModule::ata_elf() { return QList {}; } - QList result(ffi_program.elf_data, ffi_program.elf_data + raw_words.elf_size); + QList result(ffi_program.elf_data, ffi_program.elf_data + ffi_program.elf_size); wallet_ffi_free_ffi_program(&ffi_program); return result; } @@ -803,18 +810,18 @@ QList LogosExecutionZoneWalletModule::authenticated_transfer_elf() { return QList {}; } - QList result(ffi_program.elf_data, ffi_program.elf_data + raw_words.elf_size); + QList result(ffi_program.elf_data, ffi_program.elf_data + ffi_program.elf_size); wallet_ffi_free_ffi_program(&ffi_program); return result; } -QString send_generic_public_transaction( +QString LogosExecutionZoneWalletModule::send_generic_public_transaction( const QList& account_ids, const QList& signing_requirements, const QList& instruction, const QList& program_elf, - const QList>& program_dependencies, + const QList>& program_dependencies ) { QList identities_resolved; identities_resolved.reserve(account_ids.size()); @@ -833,18 +840,18 @@ QString send_generic_public_transaction( qWarning() << "wallet_ffi_resolve_public_account failed for index" << i << " : wallet FFI error" << error; return transferResultToJson(nullptr, QStringLiteral("wallet_ffi_resolve_public_account: wallet FFI error ") + QString::number(error)); } - resolved.append(acc_identity); + identities_resolved.append(acc_identity); } - const FfiAccountIdentity *account_identities = resolved.constData(); - uintptr_t account_identities_size = static_cast(resolved.size()); + const FfiAccountIdentity *account_identities = identities_resolved.constData(); + uintptr_t account_identities_size = static_cast(identities_resolved.size()); const uint8_t *input_instruction_data = instruction.constData(); uintptr_t input_instruction_data_size = static_cast(instruction.size()); FfiInstructionWords raw_words = wallet_ffi_serialization_helper(input_instruction_data, input_instruction_data_size); if (raw_words.error != SUCCESS) { qWarning() << "wallet_ffi_resolve_public_account failed at instruction serialization: wallet FFI error" << raw_words.error; - return transferResultToJson(nullptr, QStringLiteral("wallet_ffi_resolve_public_account: wallet FFI error ") + QString::number(error)); + return transferResultToJson(nullptr, QStringLiteral("wallet_ffi_resolve_public_account: wallet FFI error ") + QString::number(raw_words.error)); } FfiProgram main_program {}; @@ -887,7 +894,7 @@ QString send_generic_public_transaction( raw_words.instruction_words, raw_words.instruction_words_size, &program_with_dependencies, - result, + &result ); for (FfiAccountIdentity& acc_identity : identities_resolved) { @@ -903,11 +910,11 @@ QString send_generic_public_transaction( return resultJson; } -QString send_generic_private_transaction( +QString LogosExecutionZoneWalletModule::send_generic_private_transaction( const QList& account_ids, const QList& instruction, const QList& program_elf, - const QList>& program_dependencies, + const QList>& program_dependencies ) { QList identities_resolved; identities_resolved.reserve(account_ids.size()); @@ -921,23 +928,23 @@ QString send_generic_private_transaction( return transferResultToJson(nullptr, QStringLiteral("wallet_ffi_resolve_private_account: invalid account_id_hex")); } - WalletFfiError error = wallet_ffi_resolve_private_account(walletHandle, account_ids[i], &acc_identity); + WalletFfiError error = wallet_ffi_resolve_private_account(walletHandle, id, &acc_identity); if (error != SUCCESS) { qWarning() << "wallet_ffi_resolve_private_account failed for index" << i << " : wallet FFI error" << error; return transferResultToJson(nullptr, QStringLiteral("wallet_ffi_resolve_private_account: wallet FFI error ") + QString::number(error)); } - resolved.append(acc_identity); + identities_resolved.append(acc_identity); } - const FfiAccountIdentity *account_identities = resolved.constData(); - uintptr_t account_identities_size = static_cast(resolved.size()); + const FfiAccountIdentity *account_identities = identities_resolved.constData(); + uintptr_t account_identities_size = static_cast(identities_resolved.size()); const uint8_t *input_instruction_data = instruction.constData(); uintptr_t input_instruction_data_size = static_cast(instruction.size()); FfiInstructionWords raw_words = wallet_ffi_serialization_helper(input_instruction_data, input_instruction_data_size); if (raw_words.error != SUCCESS) { qWarning() << "wallet_ffi_resolve_private_account failed at instruction serialization: wallet FFI error" << raw_words.error; - return transferResultToJson(nullptr, QStringLiteral("wallet_ffi_resolve_private_account: wallet FFI error ") + QString::number(error)); + return transferResultToJson(nullptr, QStringLiteral("wallet_ffi_resolve_private_account: wallet FFI error ") + QString::number(raw_words.error)); } FfiProgram main_program {}; @@ -980,7 +987,7 @@ QString send_generic_private_transaction( raw_words.instruction_words, raw_words.instruction_words_size, &program_with_dependencies, - result, + &result ); for (FfiAccountIdentity& acc_identity : identities_resolved) { @@ -996,8 +1003,8 @@ QString send_generic_private_transaction( return resultJson; } -QString send_program_deployment_transaction( - const QList& program_elf, +QString LogosExecutionZoneWalletModule::send_program_deployment_transaction( + const QList& program_elf ) { FfiTransactionResult result {}; @@ -1006,9 +1013,9 @@ QString send_program_deployment_transaction( const WalletFfiError error = wallet_ffi_program_deployment( walletHandle, - elf_data, - elf_size, - result, + program_elf_data, + program_elf_size, + &result ); if (error != SUCCESS) { diff --git a/src/logos_execution_zone_wallet_module.h b/src/logos_execution_zone_wallet_module.h index d999e9d..a4dd138 100644 --- a/src/logos_execution_zone_wallet_module.h +++ b/src/logos_execution_zone_wallet_module.h @@ -128,16 +128,16 @@ public: const QList& signing_requirements, const QList& instruction, const QList& program_elf, - const QList>& program_dependencies, + const QList>& program_dependencies ) override; Q_INVOKABLE QString send_generic_private_transaction( const QList& account_ids, const QList& instruction, const QList& program_elf, - const QList>& program_dependencies, + const QList>& program_dependencies ) override; Q_INVOKABLE QString send_program_deployment_transaction( - const QList& program_elf, + const QList& program_elf ) override; // Wallet Lifecycle