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.2001 (#54)
Browse files Browse the repository at this point in the history
* Updated GraphQL templates

* Added `UpdateName` to `IProjectSchema`

* Updated compiler version for ubuntu-latest workflow from `9` to `11.3`
  • Loading branch information
BishopJohnson committed Jan 2, 2023
1 parent e32098b commit 69483ac
Show file tree
Hide file tree
Showing 15 changed files with 411 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .conan/profiles/workflows/ubuntu-latest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=9
compiler.version=11.3
os=Linux
os_build=Linux
[options]
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [1.0.0.2001] - 2023-01-02

### Added

- Added `UpdateName` request to `IProjectSchema`.

### Fixed

- Fixed GraphQL template argument type for `BridgeClaimAsset`.

## [1.0.0.2000] - 2022-07-18

### Added
Expand Down Expand Up @@ -159,7 +169,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Initial alpha release.

[Unreleased]: https://github.com/enjin/enjin-cpp-sdk/compare/1.0.0.2000...HEAD
[Unreleased]: https://github.com/enjin/enjin-cpp-sdk/compare/1.0.0.2001...HEAD

[1.0.0.2001]: https://github.com/enjin/enjin-cpp-sdk/compare/1.0.0.2000...1.0.0.2001

[1.0.0.2000]: https://github.com/enjin/enjin-cpp-sdk/compare/1.0.0.1006...1.0.0.2000

Expand Down
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.2000)
VERSION 1.0.0.2001)

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.2000
PROJECT_NUMBER = 1.0.0.2001
PROJECT_BRIEF = "A C++ SDK for creating games using the Enjin blockchain platform."
PROJECT_LOGO = doxygenIcon.png
OUTPUT_DIRECTORY =
Expand Down
6 changes: 6 additions & 0 deletions include/enjinsdk/project/IProjectSchema.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include "enjinsdk/project/SetUri.hpp"
#include "enjinsdk/project/SetWhitelisted.hpp"
#include "enjinsdk/project/UnlinkWallet.hpp"
#include "enjinsdk/project/UpdateName.hpp"
#include <future>
#include <vector>

Expand Down Expand Up @@ -238,6 +239,11 @@ class ENJINSDK_EXPORT IProjectSchema {
/// \param request The request.
/// \return The future containing the response.
virtual std::future<graphql::GraphqlResponse<bool>> unlink_wallet(UnlinkWallet request) = 0;

/// \brief Sends the UpdateName request to the platform.
/// \param request The request.
/// \return The future containing the response.
virtual std::future<graphql::GraphqlResponse<models::Transaction>> update_name(UpdateName request) = 0;
};

}
Expand Down
2 changes: 2 additions & 0 deletions include/enjinsdk/project/ProjectSchema.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ class ENJINSDK_EXPORT ProjectSchema : public IProjectSchema,

std::future<graphql::GraphqlResponse<bool>> unlink_wallet(UnlinkWallet request) override;

std::future<graphql::GraphqlResponse<models::Transaction>> update_name(UpdateName request) override;

protected:
/// \brief Constructs an instance of this class.
/// \param http_client The HTTP client.
Expand Down
119 changes: 119 additions & 0 deletions include/enjinsdk/project/UpdateName.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/* Copyright 2021 Enjin Pte. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef ENJINSDK_UPDATENAME_HPP
#define ENJINSDK_UPDATENAME_HPP

#include "enjinsdk_export.h"
#include "enjinsdk/internal/AbstractGraphqlRequest.hpp"
#include "enjinsdk/project/TransactionRequestArguments.hpp"
#include <optional>
#include <string>

namespace enjin::sdk::project {

/// \brief Request for setting the name of an existing asset.
class ENJINSDK_EXPORT UpdateName : public graphql::AbstractGraphqlRequest,
public TransactionRequestArguments<UpdateName> {
public:
/// \brief Default constructor.
UpdateName();

~UpdateName() override = default;

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

/// \brief Sets the ID of the asset to be updated.
/// \param asset_id The ID.
/// \return This request for chaining.
UpdateName& set_asset_id(std::string asset_id);

/// \brief Sets the name the asset will be updated to.
/// \param name The name.
/// \return This request for chaining.
UpdateName& set_name(std::string name);

[[nodiscard]] json::JsonValue to_json() const override;

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

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

private:
std::optional<std::string> asset_id_opt;
std::optional<std::string> name_opt;
};

// region TransactionRequestArguments

template ENJINSDK_EXPORT UpdateName&
TransactionRequestArguments<UpdateName>::set_eth_address(std::string address);

// endregion TransactionRequestArguments

}

namespace enjin::sdk::shared {

// region TransactionFragmentArguments

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_transaction_asset_id_format(
models::AssetIdFormat asset_id_format);

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_blockchain_data();

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_meta();

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_encoded_data();

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_asset_data();

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_signed_txs();

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_error();

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_nonce();

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_state();

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_receipt();

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_receipt_logs();

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_log_event();

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_transaction_project_uuid();

template ENJINSDK_EXPORT project::UpdateName&
TransactionFragmentArguments<project::UpdateName>::set_with_transaction_wallet_address();

// endregion TransactionFragmentArguments

}

#endif //ENJINSDK_UPDATENAME_HPP
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#namespace enjin.sdk.player.BridgeClaimAsset
#import enjin.sdk.shared.Transaction

#arg assetId String
#arg assetId String!

mutation {
result: BridgeClaimAsset(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#namespace enjin.sdk.project.BridgeClaimAsset
#import enjin.sdk.shared.Transaction

#arg assetId String
#arg assetId String!
#arg wallet EthAddress

mutation {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#namespace enjin.sdk.project.UpdateName
#import enjin.sdk.shared.Transaction

#arg assetId String!
#arg name String
#arg ethAddress EthAddress

mutation {
result: UpdateName(
assetId: $assetId,
name: $name,
wallet: $ethAddress
) {
...Transaction
}
}
Loading

0 comments on commit 69483ac

Please sign in to comment.