mirror of
https://github.com/logos-blockchain/logos-execution-zone-module.git
synced 2026-04-02 12:13:48 +00:00
fix: fix return type to be c++ compatible
This commit is contained in:
parent
1291c40777
commit
463800f896
@ -3,14 +3,6 @@
|
||||
|
||||
#include <core/interface.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <wallet_ffi.h>
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
class ILogosExecutionZoneWalletModule {
|
||||
public:
|
||||
virtual ~ILogosExecutionZoneWalletModule() = default;
|
||||
@ -38,7 +30,7 @@ public:
|
||||
virtual QString account_id_from_base58(const QString& base58_str) = 0;
|
||||
|
||||
// Blockchain Synchronisation
|
||||
virtual WalletFfiError sync_to_block(uint64_t block_id) = 0;
|
||||
virtual int sync_to_block(uint64_t block_id) = 0;
|
||||
virtual uint64_t get_last_synced_block() = 0;
|
||||
virtual uint64_t get_current_block_height() = 0;
|
||||
|
||||
@ -77,13 +69,13 @@ public:
|
||||
virtual QString register_private_account(const QString& account_id_hex) = 0;
|
||||
|
||||
// Wallet Lifecycle
|
||||
virtual WalletFfiError create_new(
|
||||
virtual int create_new(
|
||||
const QString& config_path,
|
||||
const QString& storage_path,
|
||||
const QString& password
|
||||
) = 0;
|
||||
virtual WalletFfiError open(const QString& config_path, const QString& storage_path) = 0;
|
||||
virtual WalletFfiError save() = 0;
|
||||
virtual int open(const QString& config_path, const QString& storage_path) = 0;
|
||||
virtual int save() = 0;
|
||||
|
||||
// Configuration & Metadata
|
||||
virtual QString get_sequencer_addr() = 0;
|
||||
|
||||
@ -302,7 +302,7 @@ QString LogosExecutionZoneWalletModule::account_id_from_base58(const QString& ba
|
||||
|
||||
// === Blockchain Synchronisation ===
|
||||
|
||||
WalletFfiError LogosExecutionZoneWalletModule::sync_to_block(const uint64_t block_id) {
|
||||
int LogosExecutionZoneWalletModule::sync_to_block(const uint64_t block_id) {
|
||||
return wallet_ffi_sync_to_block(walletHandle, block_id);
|
||||
}
|
||||
|
||||
@ -548,7 +548,7 @@ QString LogosExecutionZoneWalletModule::register_private_account(const QString&
|
||||
|
||||
// === Wallet Lifecycle ===
|
||||
|
||||
WalletFfiError LogosExecutionZoneWalletModule::create_new(
|
||||
int LogosExecutionZoneWalletModule::create_new(
|
||||
const QString& config_path,
|
||||
const QString& storage_path,
|
||||
const QString& password
|
||||
@ -571,7 +571,7 @@ WalletFfiError LogosExecutionZoneWalletModule::create_new(
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
WalletFfiError LogosExecutionZoneWalletModule::open(const QString& config_path, const QString& storage_path) {
|
||||
int LogosExecutionZoneWalletModule::open(const QString& config_path, const QString& storage_path) {
|
||||
if (walletHandle) {
|
||||
qWarning() << "open: wallet is already open";
|
||||
return INTERNAL_ERROR;
|
||||
@ -589,7 +589,7 @@ WalletFfiError LogosExecutionZoneWalletModule::open(const QString& config_path,
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
WalletFfiError LogosExecutionZoneWalletModule::save() {
|
||||
int LogosExecutionZoneWalletModule::save() {
|
||||
return wallet_ffi_save(walletHandle);
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,14 @@
|
||||
|
||||
#include "i_logos_execution_zone_wallet_module.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <wallet_ffi.h>
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
@ -48,7 +56,7 @@ public:
|
||||
Q_INVOKABLE QString account_id_from_base58(const QString& base58_str) override;
|
||||
|
||||
// Blockchain Synchronisation
|
||||
Q_INVOKABLE WalletFfiError sync_to_block(uint64_t block_id) override;
|
||||
Q_INVOKABLE int sync_to_block(uint64_t block_id) override;
|
||||
Q_INVOKABLE uint64_t get_last_synced_block() override;
|
||||
Q_INVOKABLE uint64_t get_current_block_height() override;
|
||||
|
||||
@ -87,10 +95,9 @@ public:
|
||||
Q_INVOKABLE QString register_private_account(const QString& account_id_hex) override;
|
||||
|
||||
// Wallet Lifecycle
|
||||
Q_INVOKABLE WalletFfiError
|
||||
create_new(const QString& config_path, const QString& storage_path, const QString& password) override;
|
||||
Q_INVOKABLE WalletFfiError open(const QString& config_path, const QString& storage_path) override;
|
||||
Q_INVOKABLE WalletFfiError save() override;
|
||||
Q_INVOKABLE int create_new(const QString& config_path, const QString& storage_path, const QString& password) override;
|
||||
Q_INVOKABLE int open(const QString& config_path, const QString& storage_path) override;
|
||||
Q_INVOKABLE int save() override;
|
||||
|
||||
// Configuration
|
||||
Q_INVOKABLE QString get_sequencer_addr() override;
|
||||
@ -99,4 +106,4 @@ signals:
|
||||
void eventResponse(const QString& eventName, const QVariantList& data);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
Loading…
x
Reference in New Issue
Block a user