danicoin/tests/unit_tests/TransfersObserver.h

35 lines
947 B
C
Raw Normal View History

// Copyright (c) 2011-2015 The Cryptonote developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
2014-06-25 17:21:42 +00:00
#pragma once
#include <tuple>
#include <vector>
#include "ITransfersSynchronizer.h"
2014-06-25 17:21:42 +00:00
namespace CryptoNote {
class TransfersObserver : public ITransfersObserver {
2014-06-25 17:21:42 +00:00
public:
virtual void onError(ITransfersSubscription* object, uint64_t height, std::error_code ec) override {
errors.emplace_back(height, ec);
}
virtual void onTransactionUpdated(ITransfersSubscription* object, const Hash& transactionHash) override {
updated.push_back(transactionHash);
}
virtual void onTransactionDeleted(ITransfersSubscription* object, const Hash& transactionHash) override {
deleted.push_back(transactionHash);
}
std::vector<std::tuple<uint64_t, std::error_code>> errors;
std::vector<Hash> updated;
std::vector<Hash> deleted;
2014-06-25 17:21:42 +00:00
};
}