Migrate Zcash-specific code to UniValue

This commit is contained in:
Jack Grigg
2017-01-06 19:15:56 +01:00
parent f70084cf06
commit 0d37ae3a59
19 changed files with 258 additions and 279 deletions

View File

@@ -15,13 +15,9 @@
#include <utility>
#include <future>
#include "json/json_spirit_value.h"
#include "json/json_spirit_utils.h"
#include "json/json_spirit_reader_template.h"
#include "json/json_spirit_writer_template.h"
#include "univalue/univalue.h"
using namespace std;
using namespace json_spirit;
/**
* AsyncRPCOperation objects are submitted to the AsyncRPCQueue for processing.
@@ -67,11 +63,11 @@ public:
}
// Override this method to add data to the default status object.
virtual Value getStatus() const;
virtual UniValue getStatus() const;
Value getError() const;
UniValue getError() const;
Value getResult() const;
UniValue getResult() const;
std::string getStateAsString() const;
@@ -114,7 +110,7 @@ protected:
// internal state. Currently, all operations are executed in a single-thread
// by a single worker.
mutable std::mutex lock_; // lock on this when read/writing non-atomics
Value result_;
UniValue result_;
int error_code_;
std::string error_message_;
std::atomic<OperationStatus> state_;
@@ -137,7 +133,7 @@ protected:
this->error_message_ = errorMessage;
}
void set_result(Value v) {
void set_result(UniValue v) {
std::lock_guard<std::mutex> guard(lock_);
this->result_ = v;
}