Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ jobs:
base-devel
wget

- name: Install ICU v75.1.1
- name: Install ICU v75.1
shell: msys2 {0}
run: |
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-icu-75.1-1-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-icu-75.1-1-any.pkg.tar.zst
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-icu-75.1-2-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-icu-75.1-2-any.pkg.tar.zst

- name: Install boost v1.85.0
shell: msys2 {0}
run: |
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-1.85.0-4-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-boost-1.85.0-4-any.pkg.tar.zst

- name: Install pybind11 v2.11.1
- name: Install pybind11 v2.12.0
shell: msys2 {0}
run: |
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-pybind11-2.11.1-1-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-pybind11-2.11.1-1-any.pkg.tar.zst
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-pybind11-2.12.0-1-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-pybind11-2.12.0-1-any.pkg.tar.zst

- name: Build monero
shell: msys2 {0}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,23 +164,23 @@ jobs:
base-devel
wget

- name: Install ICU v75.1.1
- name: Install ICU v75.1
shell: msys2 {0}
run: |
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-icu-75.1-1-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-icu-75.1-1-any.pkg.tar.zst
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-icu-75.1-2-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-icu-75.1-2-any.pkg.tar.zst

- name: Install boost v1.85.0
shell: msys2 {0}
run: |
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-1.85.0-4-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-boost-1.85.0-4-any.pkg.tar.zst

- name: Install pybind11 v2.11.1
- name: Install pybind11 v2.12.0
shell: msys2 {0}
run: |
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-pybind11-2.11.1-1-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-pybind11-2.11.1-1-any.pkg.tar.zst
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-pybind11-2.12.0-1-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-pybind11-2.12.0-1-any.pkg.tar.zst

- name: Clone monero-cpp (regtest)
shell: msys2 {0}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ wallet_full.close(True)

```
pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-unbound mingw-w64-x86_64-protobuf git mingw-w64-x86_64-libusb gettext base-devel
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-icu-75.1-1-any.pkg.tar.zst
pacman -U mingw-w64-x86_64-icu-75.1-1-any.pkg.tar.zst
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-icu-75.1-2-any.pkg.tar.zst
pacman -U mingw-w64-x86_64-icu-75.1-2-any.pkg.tar.zst
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-boost-1.85.0-4-any.pkg.tar.zst
pacman -U mingw-w64-x86_64-boost-1.85.0-4-any.pkg.tar.zst
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-pybind11-2.11.1-1-any.pkg.tar.zst
pacman -U mingw-w64-x86_64-pybind11-2.11.1-1-any.pkg.tar.zst
wget https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-pybind11-2.12.0-1-any.pkg.tar.zst
pacman -U mingw-w64-x86_64-pybind11-2.12.0-1-any.pkg.tar.zst
```

5. Clone repo: `git clone --recurse-submodules https://github.com/everoddandeven/monero-python.git`
Expand Down
240 changes: 210 additions & 30 deletions src/cpp/wallet/py_monero_wallet_model.cpp

Large diffs are not rendered by default.

43 changes: 41 additions & 2 deletions src/cpp/wallet/py_monero_wallet_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ struct PyOutputComparator {
class PyMoneroTxQuery : public monero::monero_tx_query {
public:

static void decontextualize(const std::shared_ptr<monero::monero_tx_query> &query);
static void decontextualize(monero::monero_tx_query &query);
static std::shared_ptr<monero::monero_tx_query> decontextualize(const std::shared_ptr<monero::monero_tx_query> &query);
static monero::monero_tx_query decontextualize(monero::monero_tx_query &query);
};

class PyMoneroOutputQuery : public monero::monero_output_query {
Expand Down Expand Up @@ -82,7 +82,11 @@ class PyMoneroTxWallet : public monero::monero_tx_wallet {
static void init_sent(const monero::monero_tx_config &config, std::shared_ptr<monero::monero_tx_wallet> &tx, bool copy_destinations);
static void from_property_tree_with_transfer(const boost::property_tree::ptree& node, const std::shared_ptr<monero::monero_tx_wallet>& tx, boost::optional<bool> &is_outgoing, const monero_tx_config &config);
static void from_property_tree_with_transfer(const boost::property_tree::ptree& node, const std::shared_ptr<monero::monero_tx_wallet>& tx, boost::optional<bool> &is_outgoing);
static void from_property_tree_with_transfer(const boost::property_tree::ptree& node, const std::shared_ptr<monero::monero_tx_wallet>& tx);
static void from_property_tree_with_transfer_and_merge(const boost::property_tree::ptree& node, std::map<std::string, std::shared_ptr<monero::monero_tx_wallet>>& tx_map, std::map<uint64_t, std::shared_ptr<monero::monero_block>>& block_map);
static void from_property_tree_with_output(const boost::property_tree::ptree& node, const std::shared_ptr<monero::monero_tx_wallet>& tx);
static void from_property_tree_with_output_and_merge(const boost::property_tree::ptree& node, std::map<std::string, std::shared_ptr<monero_tx_wallet>>& tx_map, std::map<uint64_t, std::shared_ptr<monero_block>>& block_map);
static void merge_tx(const std::shared_ptr<monero::monero_tx_wallet>& tx, std::map<std::string, std::shared_ptr<monero::monero_tx_wallet>>& tx_map, std::map<uint64_t, std::shared_ptr<monero::monero_block>>& block_map);
};

class PyMoneroTxSet : public monero::monero_tx_set {
Expand Down Expand Up @@ -966,6 +970,36 @@ class PyMoneroTransferParams : public PyMoneroJsonRequestParams {
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType& allocator) const override;
};

class PyMoneroGetTransfersParams : public PyMoneroJsonRequestParams {
public:
boost::optional<bool> m_in;
boost::optional<bool> m_out;
boost::optional<bool> m_pool;
boost::optional<bool> m_pending;
boost::optional<bool> m_failed;
boost::optional<uint64_t> m_min_height;
boost::optional<uint64_t> m_max_height;
boost::optional<bool> m_all_accounts;
boost::optional<uint32_t> m_account_index;
std::vector<uint32_t> m_subaddr_indices;

PyMoneroGetTransfersParams() {}
bool filter_by_height() const { return m_min_height != boost::none || m_max_height != boost::none; }
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType& allocator) const override;
};

class PyMoneroGetIncomingTransfersParams : public PyMoneroJsonRequestParams {
public:
boost::optional<std::string> m_transfer_type;
boost::optional<bool> m_verbose;
boost::optional<uint32_t> m_account_index;
std::vector<uint32_t> m_subaddr_indices;

PyMoneroGetIncomingTransfersParams(const std::string& transfer_type, bool verbose = true);

rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType& allocator) const override;
};

class PyMoneroCheckReserve : public monero::monero_check_reserve {
public:

Expand All @@ -990,3 +1024,8 @@ class PyMoneroMessageSignatureResult : public monero::monero_message_signature_r
static void from_property_tree(const boost::property_tree::ptree& node, const std::shared_ptr<monero::monero_message_signature_result> result);
};

// TODO expose bool_equals_2 from monero-cpp
bool bool_equals_2(bool val, const boost::optional<bool>& opt_val);
bool tx_height_less_than(const std::shared_ptr<monero_tx>& tx1, const std::shared_ptr<monero_tx>& tx2);
bool incoming_transfer_before(const std::shared_ptr<monero_incoming_transfer>& transfer1, const std::shared_ptr<monero_incoming_transfer>& transfer2);
bool vout_before(const std::shared_ptr<monero_output>& o1, const std::shared_ptr<monero_output>& o2);
Loading
Loading