Permalink
Browse files

Wallet API: add some missing override keyword

Also remove dust() from UnsignedTransactionImpl (already in PendingTransactionImpl)
  • Loading branch information...
stoffu committed Jun 13, 2018
1 parent 2329d2f commit 4510f417f9726f0043859055408a99ad62f91383
@@ -42,16 +42,16 @@ class AddressBookImpl : public AddressBook
~AddressBookImpl();

// Fetches addresses from Wallet2
void refresh();
std::vector<AddressBookRow*> getAll() const;
bool addRow(const std::string &dst_addr , const std::string &payment_id, const std::string &description);
bool deleteRow(std::size_t rowId);
void refresh() override;
std::vector<AddressBookRow*> getAll() const override;
bool addRow(const std::string &dst_addr , const std::string &payment_id, const std::string &description) override;
bool deleteRow(std::size_t rowId) override;

// Error codes. See AddressBook:ErrorCode enum in wallet2_api.h
std::string errorString() const {return m_errorString;}
int errorCode() const {return m_errorCode;}
std::string errorString() const override {return m_errorString;}
int errorCode() const override {return m_errorCode;}

int lookupPaymentID(const std::string &payment_id) const;
int lookupPaymentID(const std::string &payment_id) const override;

private:
void clearRows();
@@ -43,21 +43,21 @@ class PendingTransactionImpl : public PendingTransaction
public:
PendingTransactionImpl(WalletImpl &wallet);
~PendingTransactionImpl();
int status() const;
std::string errorString() const;
bool commit(const std::string &filename = "", bool overwrite = false);
uint64_t amount() const;
uint64_t dust() const;
uint64_t fee() const;
std::vector<std::string> txid() const;
uint64_t txCount() const;
std::vector<uint32_t> subaddrAccount() const;
std::vector<std::set<uint32_t>> subaddrIndices() const;
int status() const override;
std::string errorString() const override;
bool commit(const std::string &filename = "", bool overwrite = false) override;
uint64_t amount() const override;
uint64_t dust() const override;
uint64_t fee() const override;
std::vector<std::string> txid() const override;
uint64_t txCount() const override;
std::vector<uint32_t> subaddrAccount() const override;
std::vector<std::set<uint32_t>> subaddrIndices() const override;
// TODO: continue with interface;

std::string multisigSignData();
void signMultisigTx();
std::vector<std::string> signersKeys() const;
std::string multisigSignData() override;
void signMultisigTx() override;
std::vector<std::string> signersKeys() const override;

private:
friend class WalletImpl;
@@ -40,10 +40,10 @@ class SubaddressImpl : public Subaddress
~SubaddressImpl();

// Fetches addresses from Wallet2
void refresh(uint32_t accountIndex);
std::vector<SubaddressRow*> getAll() const;
void addRow(uint32_t accountIndex, const std::string &label);
void setLabel(uint32_t accountIndex, uint32_t addressIndex, const std::string &label);
void refresh(uint32_t accountIndex) override;
std::vector<SubaddressRow*> getAll() const override;
void addRow(uint32_t accountIndex, const std::string &label) override;
void setLabel(uint32_t accountIndex, uint32_t addressIndex, const std::string &label) override;

private:
void clearRows();
@@ -42,24 +42,24 @@ class TransactionInfoImpl : public TransactionInfo
TransactionInfoImpl();
~TransactionInfoImpl();
//! in/out
virtual int direction() const;
virtual int direction() const override;
//! true if hold
virtual bool isPending() const;
virtual bool isFailed() const;
virtual uint64_t amount() const;
virtual bool isPending() const override;
virtual bool isFailed() const override;
virtual uint64_t amount() const override;
//! always 0 for incoming txes
virtual uint64_t fee() const;
virtual uint64_t blockHeight() const;
virtual std::set<uint32_t> subaddrIndex() const;
virtual uint32_t subaddrAccount() const;
virtual std::string label() const;
virtual uint64_t fee() const override;
virtual uint64_t blockHeight() const override;
virtual std::set<uint32_t> subaddrIndex() const override;
virtual uint32_t subaddrAccount() const override;
virtual std::string label() const override;

virtual std::string hash() const;
virtual std::time_t timestamp() const;
virtual std::string paymentId() const;
virtual const std::vector<Transfer> &transfers() const;
virtual uint64_t confirmations() const;
virtual uint64_t unlockTime() const;
virtual std::string hash() const override;
virtual std::time_t timestamp() const override;
virtual std::string paymentId() const override;
virtual const std::vector<Transfer> &transfers() const override;
virtual uint64_t confirmations() const override;
virtual uint64_t unlockTime() const override;

private:
int m_direction;
@@ -43,19 +43,18 @@ class UnsignedTransactionImpl : public UnsignedTransaction
public:
UnsignedTransactionImpl(WalletImpl &wallet);
~UnsignedTransactionImpl();
int status() const;
std::string errorString() const;
std::vector<uint64_t> amount() const;
std::vector<uint64_t> dust() const;
std::vector<uint64_t> fee() const;
std::vector<uint64_t> mixin() const;
std::vector<std::string> paymentId() const;
std::vector<std::string> recipientAddress() const;
uint64_t txCount() const;
int status() const override;
std::string errorString() const override;
std::vector<uint64_t> amount() const override;
std::vector<uint64_t> fee() const override;
std::vector<uint64_t> mixin() const override;
std::vector<std::string> paymentId() const override;
std::vector<std::string> recipientAddress() const override;
uint64_t txCount() const override;
// sign txs and save to file
bool sign(const std::string &signedFileName);
std::string confirmationMessage() const {return m_confirmationMessage;}
uint64_t minMixinCount() const;
bool sign(const std::string &signedFileName) override;
std::string confirmationMessage() const override {return m_confirmationMessage;}
uint64_t minMixinCount() const override;

private:
// Callback function to check all loaded tx's and generate confirmationMessage
Oops, something went wrong.

0 comments on commit 4510f41

Please sign in to comment.