mirror of
https://github.com/logos-blockchain/logos-blockchain-module.git
synced 2026-02-19 20:43:12 +00:00
Prettify.
This commit is contained in:
parent
61fe193062
commit
89aa715837
@ -1,8 +1,8 @@
|
||||
#ifndef I_LOGOS_BLOCKCHAIN_MODULE_API_H
|
||||
#define I_LOGOS_BLOCKCHAIN_MODULE_API_H
|
||||
|
||||
#include <core/interface.h>
|
||||
#include "known_addresses.h"
|
||||
#include <core/interface.h>
|
||||
|
||||
class ILogosBlockchainModule {
|
||||
public:
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -26,15 +25,15 @@ public:
|
||||
}
|
||||
}) {}
|
||||
|
||||
size_t size() const {
|
||||
[[nodiscard]] size_t size() const {
|
||||
return data_ ? data_->len : 0;
|
||||
}
|
||||
|
||||
bool empty() const {
|
||||
[[nodiscard]] bool empty() const {
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
const uint8_t* at(size_t index) const {
|
||||
[[nodiscard]] const uint8_t* at(size_t index) const {
|
||||
if (!data_ || index >= data_->len) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -45,7 +44,7 @@ public:
|
||||
return at(index);
|
||||
}
|
||||
|
||||
bool valid() const {
|
||||
[[nodiscard]] bool valid() const {
|
||||
return data_ != nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ void LogosBlockchainModule::onNewBlockCallback(const char* block) {
|
||||
QVariantList data;
|
||||
data.append(QString::fromUtf8(block));
|
||||
s_instance->emitEvent("newBlock", data);
|
||||
free_cstring(const_cast<char*>(block)); // Free Rust-allocated memory
|
||||
free_cstring(const_cast<char*>(block)); // Free Rust-allocated memory
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ int LogosBlockchainModule::stop() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s_instance = nullptr; // Clear before stopping to prevent callbacks during shutdown
|
||||
s_instance = nullptr; // Clear before stopping to prevent callbacks during shutdown
|
||||
|
||||
const OperationStatus status = stop_node(node);
|
||||
if (is_ok(&status)) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "i_logos_blockchain_module.h"
|
||||
#include <QtCore/QDebug>
|
||||
#include <iostream>
|
||||
#include "i_logos_blockchain_module.h"
|
||||
|
||||
class LogosBlockchainModule final : public QObject, public PluginInterface, public ILogosBlockchainModule {
|
||||
Q_OBJECT
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user