This repository has been archived by the owner on Feb 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add some index for transaction listing * Add count() to OperationQuery -> To get the number of operations, WD AccountController currently fetch all operations (sql) and then count the operations (scala). This PR adds a count() method, thus the counting is done by the database wich is much faster. It aims to fix a huge memory usage when fetching account information on huge accounts with thousands of transactions * minor improvements
- Loading branch information
Showing
14 changed files
with
311 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// AUTOGENERATED FILE - DO NOT MODIFY! | ||
// This file generated by Djinni from wallet.djinni | ||
|
||
#include "OperationCount.hpp" // my header | ||
#include "Marshal.hpp" | ||
#include "OperationType.hpp" | ||
|
||
namespace djinni_generated { | ||
|
||
OperationCount::OperationCount() = default; | ||
|
||
OperationCount::~OperationCount() = default; | ||
|
||
auto OperationCount::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> { | ||
const auto& data = ::djinni::JniClass<OperationCount>::get(); | ||
auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor, | ||
::djinni::get(::djinni_generated::OperationType::fromCpp(jniEnv, c.type)), | ||
::djinni::get(::djinni::I64::fromCpp(jniEnv, c.count)))}; | ||
::djinni::jniExceptionCheck(jniEnv); | ||
return r; | ||
} | ||
|
||
auto OperationCount::toCpp(JNIEnv* jniEnv, JniType j) -> CppType { | ||
::djinni::JniLocalScope jscope(jniEnv, 3); | ||
assert(j != nullptr); | ||
const auto& data = ::djinni::JniClass<OperationCount>::get(); | ||
return {::djinni_generated::OperationType::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_type)), | ||
::djinni::I64::toCpp(jniEnv, jniEnv->GetLongField(j, data.field_count))}; | ||
} | ||
|
||
} // namespace djinni_generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// AUTOGENERATED FILE - DO NOT MODIFY! | ||
// This file generated by Djinni from wallet.djinni | ||
|
||
#ifndef DJINNI_GENERATED_OPERATIONCOUNT_HPP_JNI_ | ||
#define DJINNI_GENERATED_OPERATIONCOUNT_HPP_JNI_ | ||
|
||
#include "../../api/OperationCount.hpp" | ||
#include "djinni_support.hpp" | ||
|
||
namespace djinni_generated { | ||
|
||
class OperationCount final { | ||
public: | ||
using CppType = ::ledger::core::api::OperationCount; | ||
using JniType = jobject; | ||
|
||
using Boxed = OperationCount; | ||
|
||
~OperationCount(); | ||
|
||
static CppType toCpp(JNIEnv* jniEnv, JniType j); | ||
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c); | ||
|
||
private: | ||
OperationCount(); | ||
friend ::djinni::JniClass<OperationCount>; | ||
|
||
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("co/ledger/core/OperationCount") }; | ||
const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(Lco/ledger/core/OperationType;J)V") }; | ||
const jfieldID field_type { ::djinni::jniGetFieldID(clazz.get(), "type", "Lco/ledger/core/OperationType;") }; | ||
const jfieldID field_count { ::djinni::jniGetFieldID(clazz.get(), "count", "J") }; | ||
}; | ||
|
||
} // namespace djinni_generated | ||
#endif //DJINNI_GENERATED_OPERATIONCOUNT_HPP_JNI_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// AUTOGENERATED FILE - DO NOT MODIFY! | ||
// This file generated by Djinni from callback.djinni | ||
|
||
#include "OperationCountListCallback.hpp" // my header | ||
#include "Error.hpp" | ||
#include "Marshal.hpp" | ||
#include "OperationCount.hpp" | ||
|
||
namespace djinni_generated { | ||
|
||
OperationCountListCallback::OperationCountListCallback() : ::djinni::JniInterface<::ledger::core::api::OperationCountListCallback, OperationCountListCallback>() {} | ||
|
||
OperationCountListCallback::~OperationCountListCallback() = default; | ||
|
||
OperationCountListCallback::JavaProxy::JavaProxy(JniType j) : Handle(::djinni::jniGetThreadEnv(), j) { } | ||
|
||
OperationCountListCallback::JavaProxy::~JavaProxy() = default; | ||
|
||
void OperationCountListCallback::JavaProxy::onCallback(const std::experimental::optional<std::vector<::ledger::core::api::OperationCount>> & c_result, const std::experimental::optional<::ledger::core::api::Error> & c_error) { | ||
auto jniEnv = ::djinni::jniGetThreadEnv(); | ||
::djinni::JniLocalScope jscope(jniEnv, 10); | ||
const auto& data = ::djinni::JniClass<::djinni_generated::OperationCountListCallback>::get(); | ||
jniEnv->CallVoidMethod(Handle::get().get(), data.method_onCallback, | ||
::djinni::get(::djinni::Optional<std::experimental::optional, ::djinni::List<::djinni_generated::OperationCount>>::fromCpp(jniEnv, c_result)), | ||
::djinni::get(::djinni::Optional<std::experimental::optional, ::djinni_generated::Error>::fromCpp(jniEnv, c_error))); | ||
::djinni::jniExceptionCheck(jniEnv); | ||
} | ||
|
||
} // namespace djinni_generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// AUTOGENERATED FILE - DO NOT MODIFY! | ||
// This file generated by Djinni from callback.djinni | ||
|
||
#ifndef DJINNI_GENERATED_OPERATIONCOUNTLISTCALLBACK_HPP_JNI_ | ||
#define DJINNI_GENERATED_OPERATIONCOUNTLISTCALLBACK_HPP_JNI_ | ||
|
||
#include "../../api/OperationCountListCallback.hpp" | ||
#include "djinni_support.hpp" | ||
|
||
namespace djinni_generated { | ||
|
||
class OperationCountListCallback final : ::djinni::JniInterface<::ledger::core::api::OperationCountListCallback, OperationCountListCallback> { | ||
public: | ||
using CppType = std::shared_ptr<::ledger::core::api::OperationCountListCallback>; | ||
using CppOptType = std::shared_ptr<::ledger::core::api::OperationCountListCallback>; | ||
using JniType = jobject; | ||
|
||
using Boxed = OperationCountListCallback; | ||
|
||
~OperationCountListCallback(); | ||
|
||
static CppType toCpp(JNIEnv* jniEnv, JniType j) { return ::djinni::JniClass<OperationCountListCallback>::get()._fromJava(jniEnv, j); } | ||
static ::djinni::LocalRef<JniType> fromCppOpt(JNIEnv* jniEnv, const CppOptType& c) { return {jniEnv, ::djinni::JniClass<OperationCountListCallback>::get()._toJava(jniEnv, c)}; } | ||
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c) { return fromCppOpt(jniEnv, c); } | ||
|
||
private: | ||
OperationCountListCallback(); | ||
friend ::djinni::JniClass<OperationCountListCallback>; | ||
friend ::djinni::JniInterface<::ledger::core::api::OperationCountListCallback, OperationCountListCallback>; | ||
|
||
class JavaProxy final : ::djinni::JavaProxyHandle<JavaProxy>, public ::ledger::core::api::OperationCountListCallback | ||
{ | ||
public: | ||
JavaProxy(JniType j); | ||
~JavaProxy(); | ||
|
||
void onCallback(const std::experimental::optional<std::vector<::ledger::core::api::OperationCount>> & result, const std::experimental::optional<::ledger::core::api::Error> & error) override; | ||
|
||
private: | ||
friend ::djinni::JniInterface<::ledger::core::api::OperationCountListCallback, ::djinni_generated::OperationCountListCallback>; | ||
}; | ||
|
||
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("co/ledger/core/OperationCountListCallback") }; | ||
const jmethodID method_onCallback { ::djinni::jniGetMethodID(clazz.get(), "onCallback", "(Ljava/util/ArrayList;Lco/ledger/core/Error;)V") }; | ||
}; | ||
|
||
} // namespace djinni_generated | ||
#endif //DJINNI_GENERATED_OPERATIONCOUNTLISTCALLBACK_HPP_JNI_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.