danicoin/tests/UnitTests/TransfersObserver.h

34 lines
946 B
C
Raw Normal View History

// Copyright (c) 2011-2016 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:
2015-07-30 15:22:07 +00:00
virtual void onError(ITransfersSubscription* object, uint32_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
};
}