From 5b2e0893f996b3b74123389a2bce325de68faa38 Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Mon, 8 Jun 2026 15:29:22 +0300 Subject: [PATCH] fix: try 2 --- flake.lock | 8 +++---- flake.nix | 2 +- src/LEZWalletBackend.cpp | 51 ++++++++++++++++++++++------------------ 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/flake.lock b/flake.lock index e30b2e2..8b6052e 100644 --- a/flake.lock +++ b/flake.lock @@ -11386,17 +11386,17 @@ "nix-bundle-lgx": "nix-bundle-lgx_22" }, "locked": { - "lastModified": 1780673894, - "narHash": "sha256-Ajg0L91z64eunXmziYlFueQjgHyCCREkX3+koEQN0no=", + "lastModified": 1780921401, + "narHash": "sha256-r5d8sC8+HsJrK2i9R3b8Aeiz3ApcyTWjkovl26chEL0=", "owner": "logos-blockchain", "repo": "logos-execution-zone-module", - "rev": "9ad5e83615cabf5f88efa9cde3f94185498e9b5a", + "rev": "ee5a7e7e3b062c625a7f5af451f87a2c4ac67e4b", "type": "github" }, "original": { "owner": "logos-blockchain", "repo": "logos-execution-zone-module", - "rev": "9ad5e83615cabf5f88efa9cde3f94185498e9b5a", + "rev": "ee5a7e7e3b062c625a7f5af451f87a2c4ac67e4b", "type": "github" } }, diff --git a/flake.nix b/flake.nix index c058bb6..43de69c 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/logos-execution-zone-module?rev=9ad5e83615cabf5f88efa9cde3f94185498e9b5a"; + logos_execution_zone.url = "github:logos-blockchain/logos-execution-zone-module?rev=ee5a7e7e3b062c625a7f5af451f87a2c4ac67e4b"; }; outputs = inputs@{ logos-module-builder, ... }: diff --git a/src/LEZWalletBackend.cpp b/src/LEZWalletBackend.cpp index 3225343..2642238 100644 --- a/src/LEZWalletBackend.cpp +++ b/src/LEZWalletBackend.cpp @@ -227,6 +227,8 @@ QString LEZWalletBackend::transferPublic(QString fromHex, QString toHex, QString QList account_ids = { fromHex, toHex }; QList signing_requirements = { true, false }; + QByteArray elf_byte_array = m_logos->logos_execution_zone.authenticated_transfer_elf().value(); + const QString amountHex = amountToLe16Hex(amountStr); if (amountHex.isEmpty()) return QStringLiteral("Error: Invalid amount."); @@ -245,7 +247,6 @@ QString LEZWalletBackend::transferPublic(QString fromHex, QString toHex, QString const QList& input_data_raw_ref = input_data_raw; QList input_data = m_logos->logos_execution_zone.serialization_helper(input_data_raw_ref); - QList elf = m_logos->logos_execution_zone.authenticated_transfer_elf(); QList> program_dependencies; @@ -273,31 +274,35 @@ QString LEZWalletBackend::transferPrivate(QString fromHex, QString toHex, QStrin QString LEZWalletBackend::transferPrivateOwned(QString fromHex, QString toHex, QString amountStr) { - QList account_ids = { fromHex, toHex }; + // QList account_ids = { fromHex, toHex }; + + // const QString amountHex = amountToLe16Hex(amountStr); + // if (amountHex.isEmpty()) return QStringLiteral("Error: Invalid amount."); + + // uint8_t amount[16]; + // if (!hexToU128(amountHex, &amount)) { + // return QStringLiteral("Error: Invalid amount."); + // } + + // QList input_data_raw; + // input_data_raw.reserve(17); + // input_data_raw.append(0); + // for (int i = 0; i < 16; i++) { + // input_data_raw.append(amount[i]); + // } + + // QList input_data = m_logos->logos_execution_zone.serialization_helper(&input_data_raw); + // QList elf = m_logos->logos_execution_zone.authenticated_transfer_elf(); + + // QList> program_dependencies; + + // const QList& account_ids_ref = account_ids; + + // return m_logos->logos_execution_zone.send_generic_private_transaction(account_ids_ref, &input_data, &elf, &program_dependencies); const QString amountHex = amountToLe16Hex(amountStr); if (amountHex.isEmpty()) return QStringLiteral("Error: Invalid amount."); - - uint8_t amount[16]; - if (!hexToU128(amountHex, &amount)) { - return QStringLiteral("Error: Invalid amount."); - } - - QList input_data_raw; - input_data_raw.reserve(17); - input_data_raw.append(0); - for (int i = 0; i < 16; i++) { - input_data_raw.append(amount[i]); - } - - QList input_data = m_logos->logos_execution_zone.serialization_helper(&input_data_raw); - QList elf = m_logos->logos_execution_zone.authenticated_transfer_elf(); - - QList> program_dependencies; - - const QList& account_ids_ref = account_ids; - - return m_logos->logos_execution_zone.send_generic_private_transaction(account_ids_ref, &input_data, &elf, &program_dependencies); + return m_logos->logos_execution_zone.transfer_private_owned(fromHex, toHex.trimmed(), amountHex); } bool LEZWalletBackend::createNew(QString configPath, QString storagePath, QString password)