Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Release 1.0.0.1005 (#44)
Browse files Browse the repository at this point in the history
* Fixed serialization issue with argument interfaces (#42)

* Updated transaction and wallet models (#43)

* Added subsection under `Installation` in `README.md` for Conan
  • Loading branch information
BishopJohnson committed May 23, 2022
1 parent 6a847ec commit 2779d41
Show file tree
Hide file tree
Showing 106 changed files with 3,938 additions and 1,044 deletions.
46 changes: 45 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,93 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.0.0.1005] - 2022-05-23

### Added

- Added arguments and fields to `Transaction.gql` template file for getting the wallet address.
- Added arguments and fields to `Wallet.gql` template file for getting balances and transactions.
- Added `set_with_transaction_wallet_address` member-function to `TransactionFragmentArguments`.
- Added `set_wallet_balance_filter`, `set_with_wallet_balances`, and `set_with_wallet_transaction` member-functions
to `WalletFragmentArguments`.
- Added getters for balances and transactions to `Wallet` model.

### Changed

- Refactored `Balance`, `Player`, `Request`, and `Wallet` models to use pimpl idiom.
- Changed name of member-function `set_asset_id_format` in `TransactionFragmentArguments`
to `set_transaction_asset_id_format`.
- `WalletFragmentArguments` now implements `BalanceFragmentArguments` and `TransactionFragmentArguments`.

### Fixed

- Fixed issue with argument interfaces not serializing data from parent argument interfaces.
- Fixed missing equality operator in `ProjectTransactionRequestArguments`.

## [1.0.0.1004] - 2022-04-25

### Changed

- Removed `set_project_uuid` and `set_project_uuid_in` member-functions from `BalanceFilter`.

## [1.0.0.1003] - 2022-04-11

### Changed

- `GetWallets` query in project schema no longer implements `PaginationArguments`.

### Fixed

- Fixed typo for `result` in `GetWallets.gql` template file for project schema.

## [1.0.0.1002] - 2022-03-01

### Changed

- Updated path to template generation command in root CMakeLists file.
- Updated regular expression used by `TemplateLoader` to match a wider range of characters leading to the "schemas"
folder.

### Fixed

- Fixed package installation procedure in root CMakeLists file.

## [1.0.0.1001] - 2021-11-09

### Added

- Added [Enjin Bridge mutations](https://docs.enjin.io/enjin-api/sending-and-receiving-requests/enjin-bridge) for
project and player schemas.
- Added `get_asset` member-function to `Request`.
- Added `set_asset_id_format` method to `TransactionFragmentArguments`.

### Changed

- The asset for transactions is now included in returned `Request` models when using `set_with_asset_data()` in requests
which inherit `TransactionFragmentArguments`.

## [1.0.0.1000] - 2021-09-27

### Added

- Initial alpha release.

[Unreleased]: https://github.com/enjin/enjin-cpp-sdk/compare/1.0.0.1004...HEAD
[Unreleased]: https://github.com/enjin/enjin-cpp-sdk/compare/1.0.0.1005...HEAD

[1.0.0.1005]: https://github.com/enjin/enjin-cpp-sdk/compare/1.0.0.1004...1.0.0.1005

[1.0.0.1004]: https://github.com/enjin/enjin-cpp-sdk/compare/1.0.0.1003...1.0.0.1004

[1.0.0.1003]: https://github.com/enjin/enjin-cpp-sdk/compare/1.0.0.1002...1.0.0.1003

[1.0.0.1002]: https://github.com/enjin/enjin-cpp-sdk/compare/1.0.0.1001...1.0.0.1002

[1.0.0.1001]: https://github.com/enjin/enjin-cpp-sdk/compare/1.0.0.1000...1.0.0.1001

[1.0.0.1000]: https://github.com/enjin/enjin-cpp-sdk/releases/tag/1.0.0.1000
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(GenerateExportHeader)
### Define project and set properties
project(enjinsdk
LANGUAGES CXX
VERSION 1.0.0.1004)
VERSION 1.0.0.1005)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
Expand Down
2 changes: 1 addition & 1 deletion DOXYFILE
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "Enjin C++ SDK"
PROJECT_NUMBER = 1.0.0.1004
PROJECT_NUMBER = 1.0.0.1005
PROJECT_BRIEF = "A C++ SDK for creating games using the Enjin blockchain platform."
PROJECT_LOGO = doxygenIcon.png
OUTPUT_DIRECTORY =
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Sign up to Enjin Cloud: [Kovan (Testnet)](https://kovan.cloud.enjin.io/),

* [Compatibility](#compatibility)
* [Installation](#installation)
* [Conan](#conan)
* [Manual](#manual)
* [Tests](#tests)
* [Quick Start](#quick-start)
* [Contributing](#contributing)
Expand All @@ -37,6 +39,13 @@ combinations tested are as follows:

## Installation

### Conan

Recipes for this SDK are available on [Conan Center](https://conan.io/center/enjincppsdk) for installation and package
management.

### Manual

The SDK may be built as a static or shared (dynamic) library. Use the `ENJINSDK_BUILD_SHARED` CMake argument to build as
a shared library and set it to "on" (off by default).

Expand All @@ -50,7 +59,7 @@ The following libraries are used by the SDK for some of its functionality and mu
* [RapidJSON (1.1.0+)](https://github.com/Tencent/rapidjson) for processing JSON
* [spdlog (1.8.0+)](https://github.com/gabime/spdlog) for the logger class
* (optional) [cpp-httplib (0.8.5+)](https://github.com/yhirose/cpp-httplib) for a default HTTP client implementation
* [openssl (1.1.1)](https://github.com/openssl/openssl) for HTTPS support
* [openssl (1.1.1)](https://github.com/openssl/openssl) for HTTPS support
* (optional) [IXWebSocket (11.0.4+)](https://github.com/machinezone/IXWebSocket) for a default websocket client
implementation

Expand Down Expand Up @@ -84,8 +93,9 @@ to your target.

### Tests

For running unit tests [Git (1.6.5+)](https://git-scm.com/) is required to run CMake's `ExternalProject_Add()` function
to acquire [Googletest (1.10.0+)](https://github.com/google/googletest) to be used as the testing framework.
For running unit tests in **manual** installations, [Git (1.6.5+)](https://git-scm.com/) is required to run
CMake's `ExternalProject_Add()` function to acquire [Googletest (1.10.0+)](https://github.com/google/googletest) for the
testing framework.

To have the test executable built, set the CMake argument `ENJINSDK_BUILD_TESTS` to `ON` and leave the `BUILD_TESTING`
option from CTest enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ENJINSDK_EXPORT TransactionFragmentArgumentsImpl : public serialization::I

/// \brief Sets the value for the associated field to the passed value.
/// \param asset_id_format The ID format.
void set_asset_id_format(models::AssetIdFormat asset_id_format);
void set_transaction_asset_id_format(models::AssetIdFormat asset_id_format);

/// \brief Sets the value for the associated field to true.
void set_with_blockchain_data();
Expand Down Expand Up @@ -73,12 +73,15 @@ class ENJINSDK_EXPORT TransactionFragmentArgumentsImpl : public serialization::I
/// \brief Sets the value for the associated field to true.
void set_with_transaction_project_uuid();

/// \brief Sets the value for the associated field to true.
void set_with_transaction_wallet_address();

bool operator==(const TransactionFragmentArgumentsImpl& rhs) const;

bool operator!=(const TransactionFragmentArgumentsImpl& rhs) const;

private:
std::optional<models::AssetIdFormat> asset_id_format;
std::optional<models::AssetIdFormat> transaction_asset_id_format;
std::optional<bool> with_blockchain_data;
std::optional<bool> with_meta;
std::optional<bool> with_encoded_data;
Expand All @@ -91,6 +94,7 @@ class ENJINSDK_EXPORT TransactionFragmentArgumentsImpl : public serialization::I
std::optional<bool> with_receipt_logs;
std::optional<bool> with_log_event;
std::optional<bool> with_transaction_project_uuid;
std::optional<bool> with_transaction_wallet_address;
};

}
Expand Down
20 changes: 19 additions & 1 deletion include/enjinsdk/internal/WalletFragmentArgumentsImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@

#include "enjinsdk_export.h"
#include "enjinsdk/internal/AssetFragmentArgumentsImpl.hpp"
#include "enjinsdk/internal/BalanceFragmentArgumentsImpl.hpp"
#include "enjinsdk/internal/TransactionFragmentArgumentsImpl.hpp"
#include "enjinsdk/models/BalanceFilter.hpp"
#include <optional>
#include <string>

namespace enjin::sdk::shared {

/// \brief Internal implementation class for storing values of a GraphQL Wallet fragment.
class ENJINSDK_EXPORT WalletFragmentArgumentsImpl : public AssetFragmentArgumentsImpl {
class ENJINSDK_EXPORT WalletFragmentArgumentsImpl : public AssetFragmentArgumentsImpl,
public BalanceFragmentArgumentsImpl,
public TransactionFragmentArgumentsImpl {
public:
/// \brief Default constructor.
WalletFragmentArgumentsImpl() = default;
Expand All @@ -33,15 +38,28 @@ class ENJINSDK_EXPORT WalletFragmentArgumentsImpl : public AssetFragmentArgument

[[nodiscard]] std::string serialize() const override;

/// \brief Sets the value for the associated field to the passed value.
/// \param filter The filter.
void set_wallet_balance_filter(models::BalanceFilter filter);

/// \brief Sets the value for the associated field to true.
void set_with_assets_created();

/// \brief Sets the value for the associated field to true.
void set_with_wallet_balances();

/// \brief Sets the value for the associated field to true.
void set_with_wallet_transactions();

bool operator==(const WalletFragmentArgumentsImpl& rhs) const;

bool operator!=(const WalletFragmentArgumentsImpl& rhs) const;

private:
std::optional<models::BalanceFilter> wallet_balance_filter;
std::optional<bool> with_assets_created;
std::optional<bool> with_wallet_balances;
std::optional<bool> with_wallet_transactions;
};

}
Expand Down
34 changes: 20 additions & 14 deletions include/enjinsdk/models/Balance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,30 @@
#include "enjinsdk/IDeserializable.hpp"
#include "enjinsdk/models/Project.hpp"
#include "enjinsdk/models/Wallet.hpp"
#include <memory>
#include <optional>
#include <string>

namespace enjin::sdk::models {

class Wallet;

/// \brief Models a asset balance.
class ENJINSDK_EXPORT Balance : public serialization::IDeserializable {
public:
/// \brief Default constructor.
Balance() = default;
/// \brief Constructs an instance of this class.
Balance();

/// \brief Constructs an instance as a copy of another.
/// \param other The other instance.
Balance(const Balance& other);

/// \brief Constructs an instance via move.
/// \param other The other instance being moved.
Balance(Balance&& other) noexcept;

~Balance() override = default;
/// \brief Deconstructs this instance.
~Balance() override;

void deserialize(const std::string& json) override;

Expand Down Expand Up @@ -59,18 +71,12 @@ class ENJINSDK_EXPORT Balance : public serialization::IDeserializable {

bool operator!=(const Balance& rhs) const;

Balance& operator=(const Balance& rhs);

private:
std::optional<std::string> id;
std::optional<std::string> index;
std::optional<int> value;
std::optional<Project> project;
std::optional<Wallet> wallet;

constexpr static char ID_KEY[] = "id";
constexpr static char INDEX_KEY[] = "index";
constexpr static char VALUE_KEY[] = "value";
constexpr static char PROJECT_KEY[] = "project";
constexpr static char WALLET_KEY[] = "wallet";
class Impl;

std::unique_ptr<Impl> impl;
};

}
Expand Down
32 changes: 18 additions & 14 deletions include/enjinsdk/models/Player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "enjinsdk/IDeserializable.hpp"
#include "enjinsdk/models/LinkingInfo.hpp"
#include "enjinsdk/models/Wallet.hpp"
#include <memory>
#include <optional>
#include <string>

Expand All @@ -28,10 +29,19 @@ namespace enjin::sdk::models {
/// \brief Models a player on the platform.
class ENJINSDK_EXPORT Player : public serialization::IDeserializable {
public:
/// \brief Default constructor.
Player() = default;
/// \brief Constructs an instance of this class.
Player();

~Player() override = default;
/// \brief Constructs an instance as a copy of another.
/// \param other The other instance.
Player(const Player& other);

/// \brief Constructs an instance via move.
/// \param other The other instance being moved.
Player(Player&& other) noexcept;

/// \brief Deconstructs this instance.
~Player() override;

void deserialize(const std::string& json) override;

Expand Down Expand Up @@ -61,18 +71,12 @@ class ENJINSDK_EXPORT Player : public serialization::IDeserializable {

bool operator!=(const Player& rhs) const;

Player& operator=(const Player& rhs);

private:
std::optional<std::string> id;
std::optional<LinkingInfo> linking_info;
std::optional<Wallet> wallet;
std::optional<std::string> created_at;
std::optional<std::string> updated_at;

constexpr static char ID_KEY[] = "id";
constexpr static char LINKING_INFO_KEY[] = "linkingInfo";
constexpr static char WALLET_KEY[] = "wallet";
constexpr static char CREATED_AT_KEY[] = "createdAt";
constexpr static char UPDATED_AT_KEY[] = "updatedAt";
class Impl;

std::unique_ptr<Impl> impl;
};

}
Expand Down
Loading

0 comments on commit 2779d41

Please sign in to comment.