From 8cd68147d85d51e795a3f8ff5d6dc656fee1fc86 Mon Sep 17 00:00:00 2001 From: Jongwhan Lee <51560997+leejw51crypto@users.noreply.github.com> Date: Fri, 24 May 2024 01:24:04 +0900 Subject: [PATCH] Problem: missing verify function for personal_sign (fix #354) (#355) Add verify signature for walletconnect 2.0 --- CHANGELOG.md | 9 +-- Makefile | 2 +- .../Private/DynamicContractObject.cpp | 3 +- .../Private/PlayCppSdkActor.cpp | 48 ++++++++++++++++ .../CronosPlayUnreal/Public/PlayCppSdkActor.h | 15 +++++ Source/CronosPlayUnreal/Public/Utlis.h | 4 +- .../defi-wallet-core-cpp/src/contract.rs.cc | 22 ++++---- .../defi-wallet-core-cpp/src/contract.rs.h | 16 +++--- .../Include/defi-wallet-core-cpp/src/core.cc | 28 +++++----- .../defi-wallet-core-cpp/src/ethereum.rs.cc | 28 +++++----- .../defi-wallet-core-cpp/src/ethereum.rs.h | 22 ++++---- .../Include/defi-wallet-core-cpp/src/lib.rs.h | 22 ++++---- .../defi-wallet-core-cpp/src/nft.rs.cc | 26 +++++---- .../Include/defi-wallet-core-cpp/src/nft.rs.h | 20 +++---- .../defi-wallet-core-cpp/src/uint.rs.cc | 18 +++--- .../defi-wallet-core-cpp/src/uint.rs.h | 16 +++--- .../Include/extra-cpp-bindings/src/lib.rs.cc | 56 +++++++++++++++---- .../Include/extra-cpp-bindings/src/lib.rs.h | 30 ++++++---- .../PlayCppSdkLibrary/Include/rust/cxx.h | 28 +++++----- 19 files changed, 263 insertions(+), 150 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f97a8d..420f7a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,17 @@ # Changelog ## [Unreleased] - +- Add verify signature for walletconnect 2.0 + ## [v0.0.19-alpha] - 2024-4-27 -- Fix WC 2.0 for defiwallet +- Fix WC 2.0 for defiwallet - Support UE 5.4 ## [v0.0.18-alpha] - 2024-1-2 - Support metamask send-tx for wallet-connect 2.0 - Support Unreal Engine 5.3.0 -- Add weakptr checking for WalletConnect 2.0 +- Add weakptr checking for WalletConnect 2.0 ## [v0.0.17-alpha] - 2023-8-10 @@ -22,7 +23,7 @@ ## [v0.0.13-alpha] - 2023-6-15 - Support apple arm64 - Support Unreal Engine 5.2.0 -- Update play-cpp-sdk headerfiles +- Update play-cpp-sdk headerfiles ## [v0.0.12-alpha] - 2023-5-04 - Support sending transactions using Metamask and Crypto.com Defi Wallet diff --git a/Makefile b/Makefile index 322ed3e..b228218 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ UNAME := $(shell uname) PWD = $(shell pwd) # Set the play cpp sdk version -PLAYCPPSDK=v0.0.26-alpha +PLAYCPPSDK=v0.0.27-alpha # Set the play-cpp-sdk cache path PLAYCPPSDK_CACHE_DIR=./install/$(PLAYCPPSDK) # Set the play-cpp-sdk target path diff --git a/Source/CronosPlayUnreal/Private/DynamicContractObject.cpp b/Source/CronosPlayUnreal/Private/DynamicContractObject.cpp index f47e007..300c2d5 100644 --- a/Source/CronosPlayUnreal/Private/DynamicContractObject.cpp +++ b/Source/CronosPlayUnreal/Private/DynamicContractObject.cpp @@ -182,8 +182,7 @@ void UDynamicContractObject::NewSigningEthContract(FString contractaddress, } char hdpath[100]; - snprintf(hdpath, sizeof(hdpath), "m/44'/%d'/0'/0/%d", 60, - walletindex); + snprintf(hdpath, sizeof(hdpath), "m/44'/%d'/0'/0/%d", 60, walletindex); rust::cxxbridge1::Box privatekey = defiWallet->getCoreWallet()->get_key(hdpath); diff --git a/Source/CronosPlayUnreal/Private/PlayCppSdkActor.cpp b/Source/CronosPlayUnreal/Private/PlayCppSdkActor.cpp index 2e24665..d929955 100644 --- a/Source/CronosPlayUnreal/Private/PlayCppSdkActor.cpp +++ b/Source/CronosPlayUnreal/Private/PlayCppSdkActor.cpp @@ -20,6 +20,7 @@ using namespace std; using namespace rust; using namespace com::crypto::game_sdk; +void from_hex(const std::string &s, unsigned char *data, int len); // Sets default values APlayCppSdkActor::APlayCppSdkActor() { @@ -573,6 +574,53 @@ void copyVecToTArray(const Vec &src, TArray &dst) { assert(dst.Num() == src.size()); } +void APlayCppSdkActor::VerifyPersonal(FString user_message, + TArray signature_bytes, + FString user_address, bool &success, + FString &output_message) { + if (NULL == _coreClient) { + success = false; + output_message = TEXT("Invalid Client"); + + return; + } + + // Remove the "0x" prefix from user_address if it exists + if (user_address.StartsWith("0x")) { + user_address = user_address.RightChop( + 2); // skip 2 bytes, get right side of the string + } + + if (user_address.Len() != 40) { + success = false; + output_message = TEXT("Invalid address, address should be 20 bytes hex " + "string without 0x prefix"); + return; + } + + Vec signature; + copyTArrayToVec(signature_bytes, + signature); // convert unreal array to c++ vector + std::array dstaddress; // address is fixed 20 bytes + from_hex(TCHAR_TO_UTF8(*user_address), dstaddress.data(), 20); + + try { + bool ret = _coreClient->verify_personal_blocking( + TCHAR_TO_UTF8(*user_message), signature, dstaddress); + if (ret) { + success = true; + } else { + success = false; + output_message = TEXT("Signature verification failed"); + } + } catch (const std::exception &e) { + success = false; + output_message = + FString::Printf(TEXT("PlayCppSdk VerifyPersonal Error: %s"), + UTF8_TO_TCHAR(e.what())); + } +} + void APlayCppSdkActor::SignPersonal(FString user_message, FWalletconnectSignPersonalDelegate Out) { ::com::crypto::game_sdk::Walletconnect2Client *coreclient = GetClient(); diff --git a/Source/CronosPlayUnreal/Public/PlayCppSdkActor.h b/Source/CronosPlayUnreal/Public/PlayCppSdkActor.h index 0c881ef..d33f105 100644 --- a/Source/CronosPlayUnreal/Public/PlayCppSdkActor.h +++ b/Source/CronosPlayUnreal/Public/PlayCppSdkActor.h @@ -505,6 +505,21 @@ class CRONOSPLAYUNREAL_API APlayCppSdkActor : public AActor { void SignPersonal(FString user_message, FWalletconnectSignPersonalDelegate Out); + /** + * verify general message + * @param user_message user message to verify + * @param signature signature byte arrays + * @param user_address user address + * @return success or not + * @return output_message error message + */ + UFUNCTION(BlueprintCallable, + meta = (DisplayName = "VerifyPersonal", Keywords = "PlayCppSdk"), + Category = "PlayCppSdk") + void VerifyPersonal(FString user_message, TArray signature_bytes, + FString user_address, bool &success, + FString &output_message); + /** * sign EIP155 tx * @param info EIP 155 tx information diff --git a/Source/CronosPlayUnreal/Public/Utlis.h b/Source/CronosPlayUnreal/Public/Utlis.h index 33f5430..268c41b 100644 --- a/Source/CronosPlayUnreal/Public/Utlis.h +++ b/Source/CronosPlayUnreal/Public/Utlis.h @@ -23,7 +23,7 @@ class CRONOSPLAYUNREAL_API UUtlis : public UBlueprintFunctionLibrary { UFUNCTION(BlueprintCallable, meta = (DisplayName = "ToHex", Keywords = "PlayCppSdk"), Category = "Utils") - static FString ToHex(const TArray& address); + static FString ToHex(const TArray &address); /** * Convert TArray to std::array @@ -32,5 +32,5 @@ class CRONOSPLAYUNREAL_API UUtlis : public UBlueprintFunctionLibrary { * return all 0 * */ - static std::array ToArray(const TArray& address); + static std::array ToArray(const TArray &address); }; diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/contract.rs.cc b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/contract.rs.cc index f086ce0..49290e5 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/contract.rs.cc +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/contract.rs.cc @@ -55,8 +55,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -110,8 +110,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -124,8 +124,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -398,7 +398,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -464,7 +464,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); @@ -605,7 +605,7 @@ class Error final : public std::exception { ~Error() noexcept override; Error &operator=(const Error &) &; - Error &operator=(Error &&) &noexcept; + Error &operator=(Error &&) & noexcept; const char *what() const noexcept override; @@ -680,7 +680,9 @@ template std::size_t align_of() { return layout::align_of(); } #ifndef CXXBRIDGE1_RELOCATABLE #define CXXBRIDGE1_RELOCATABLE namespace detail { -template struct make_void { using type = void; }; +template struct make_void { + using type = void; +}; template using void_t = typename make_void::type; diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/contract.rs.h b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/contract.rs.h index f736a4f..23bc99e 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/contract.rs.h +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/contract.rs.h @@ -55,8 +55,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -110,8 +110,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -124,8 +124,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -398,7 +398,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -464,7 +464,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/core.cc b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/core.cc index c871c6f..d25d071 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/core.cc +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/core.cc @@ -52,8 +52,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -108,7 +108,7 @@ class Str final { Str(const char *); Str(const char *, std::size_t); - Str &operator=(const Str &) &noexcept = default; + Str &operator=(const Str &) & noexcept = default; explicit operator std::string() const; @@ -154,8 +154,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -168,8 +168,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -439,7 +439,7 @@ template class Box final { explicit Box(const T &); explicit Box(T &&); - Box &operator=(Box &&) &noexcept; + Box &operator=(Box &&) & noexcept; const T *operator->() const noexcept; const T &operator*() const noexcept; @@ -507,7 +507,7 @@ template Box::~Box() noexcept { } } -template Box &Box::operator=(Box &&other) &noexcept { +template Box &Box::operator=(Box &&other) & noexcept { if (this->ptr) { this->drop(); } @@ -577,7 +577,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -643,7 +643,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); @@ -784,7 +784,7 @@ class Error final : public std::exception { ~Error() noexcept override; Error &operator=(const Error &) &; - Error &operator=(Error &&) &noexcept; + Error &operator=(Error &&) & noexcept; const char *what() const noexcept override; @@ -869,7 +869,9 @@ template std::size_t align_of() { return layout::align_of(); } #ifndef CXXBRIDGE1_RELOCATABLE #define CXXBRIDGE1_RELOCATABLE namespace detail { -template struct make_void { using type = void; }; +template struct make_void { + using type = void; +}; template using void_t = typename make_void::type; diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/ethereum.rs.cc b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/ethereum.rs.cc index 403ca74..a411d8d 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/ethereum.rs.cc +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/ethereum.rs.cc @@ -52,8 +52,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -108,7 +108,7 @@ class Str final { Str(const char *); Str(const char *, std::size_t); - Str &operator=(const Str &) &noexcept = default; + Str &operator=(const Str &) & noexcept = default; explicit operator std::string() const; @@ -154,8 +154,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -168,8 +168,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -439,7 +439,7 @@ template class Box final { explicit Box(const T &); explicit Box(T &&); - Box &operator=(Box &&) &noexcept; + Box &operator=(Box &&) & noexcept; const T *operator->() const noexcept; const T &operator*() const noexcept; @@ -507,7 +507,7 @@ template Box::~Box() noexcept { } } -template Box &Box::operator=(Box &&other) &noexcept { +template Box &Box::operator=(Box &&other) & noexcept { if (this->ptr) { this->drop(); } @@ -577,7 +577,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -643,7 +643,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); @@ -784,7 +784,7 @@ class Error final : public std::exception { ~Error() noexcept override; Error &operator=(const Error &) &; - Error &operator=(Error &&) &noexcept; + Error &operator=(Error &&) & noexcept; const char *what() const noexcept override; @@ -869,7 +869,9 @@ template std::size_t align_of() { return layout::align_of(); } #ifndef CXXBRIDGE1_RELOCATABLE #define CXXBRIDGE1_RELOCATABLE namespace detail { -template struct make_void { using type = void; }; +template struct make_void { + using type = void; +}; template using void_t = typename make_void::type; diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/ethereum.rs.h b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/ethereum.rs.h index 0895fd2..182d000 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/ethereum.rs.h +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/ethereum.rs.h @@ -52,8 +52,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -108,7 +108,7 @@ class Str final { Str(const char *); Str(const char *, std::size_t); - Str &operator=(const Str &) &noexcept = default; + Str &operator=(const Str &) & noexcept = default; explicit operator std::string() const; @@ -154,8 +154,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -168,8 +168,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -439,7 +439,7 @@ template class Box final { explicit Box(const T &); explicit Box(T &&); - Box &operator=(Box &&) &noexcept; + Box &operator=(Box &&) & noexcept; const T *operator->() const noexcept; const T &operator*() const noexcept; @@ -507,7 +507,7 @@ template Box::~Box() noexcept { } } -template Box &Box::operator=(Box &&other) &noexcept { +template Box &Box::operator=(Box &&other) & noexcept { if (this->ptr) { this->drop(); } @@ -577,7 +577,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -643,7 +643,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/lib.rs.h b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/lib.rs.h index b021bec..79e203a 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/lib.rs.h +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/lib.rs.h @@ -52,8 +52,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -108,7 +108,7 @@ class Str final { Str(const char *); Str(const char *, std::size_t); - Str &operator=(const Str &) &noexcept = default; + Str &operator=(const Str &) & noexcept = default; explicit operator std::string() const; @@ -154,8 +154,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -168,8 +168,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -439,7 +439,7 @@ template class Box final { explicit Box(const T &); explicit Box(T &&); - Box &operator=(Box &&) &noexcept; + Box &operator=(Box &&) & noexcept; const T *operator->() const noexcept; const T &operator*() const noexcept; @@ -507,7 +507,7 @@ template Box::~Box() noexcept { } } -template Box &Box::operator=(Box &&other) &noexcept { +template Box &Box::operator=(Box &&other) & noexcept { if (this->ptr) { this->drop(); } @@ -577,7 +577,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -643,7 +643,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/nft.rs.cc b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/nft.rs.cc index dbc69d1..a487956 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/nft.rs.cc +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/nft.rs.cc @@ -53,8 +53,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -108,8 +108,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -122,8 +122,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -393,7 +393,7 @@ template class Box final { explicit Box(const T &); explicit Box(T &&); - Box &operator=(Box &&) &noexcept; + Box &operator=(Box &&) & noexcept; const T *operator->() const noexcept; const T &operator*() const noexcept; @@ -461,7 +461,7 @@ template Box::~Box() noexcept { } } -template Box &Box::operator=(Box &&other) &noexcept { +template Box &Box::operator=(Box &&other) & noexcept { if (this->ptr) { this->drop(); } @@ -531,7 +531,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -597,7 +597,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); @@ -738,7 +738,7 @@ class Error final : public std::exception { ~Error() noexcept override; Error &operator=(const Error &) &; - Error &operator=(Error &&) &noexcept; + Error &operator=(Error &&) & noexcept; const char *what() const noexcept override; @@ -823,7 +823,9 @@ template std::size_t align_of() { return layout::align_of(); } #ifndef CXXBRIDGE1_RELOCATABLE #define CXXBRIDGE1_RELOCATABLE namespace detail { -template struct make_void { using type = void; }; +template struct make_void { + using type = void; +}; template using void_t = typename make_void::type; diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/nft.rs.h b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/nft.rs.h index bddc9b8..f81788c 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/nft.rs.h +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/nft.rs.h @@ -53,8 +53,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -108,8 +108,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -122,8 +122,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -393,7 +393,7 @@ template class Box final { explicit Box(const T &); explicit Box(T &&); - Box &operator=(Box &&) &noexcept; + Box &operator=(Box &&) & noexcept; const T *operator->() const noexcept; const T &operator*() const noexcept; @@ -461,7 +461,7 @@ template Box::~Box() noexcept { } } -template Box &Box::operator=(Box &&other) &noexcept { +template Box &Box::operator=(Box &&other) & noexcept { if (this->ptr) { this->drop(); } @@ -531,7 +531,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -597,7 +597,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/uint.rs.cc b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/uint.rs.cc index 5ae4917..5377888 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/uint.rs.cc +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/uint.rs.cc @@ -53,8 +53,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -108,8 +108,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -122,8 +122,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -396,7 +396,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -462,7 +462,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); @@ -603,7 +603,7 @@ class Error final : public std::exception { ~Error() noexcept override; Error &operator=(const Error &) &; - Error &operator=(Error &&) &noexcept; + Error &operator=(Error &&) & noexcept; const char *what() const noexcept override; diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/uint.rs.h b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/uint.rs.h index e4d5f34..83d47ca 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/uint.rs.h +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/defi-wallet-core-cpp/src/uint.rs.h @@ -53,8 +53,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -108,8 +108,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -122,8 +122,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -396,7 +396,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -462,7 +462,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.cc b/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.cc index 3be6b18..97e3f77 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.cc +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.cc @@ -55,8 +55,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -111,7 +111,7 @@ class Str final { Str(const char *); Str(const char *, std::size_t); - Str &operator=(const Str &) &noexcept = default; + Str &operator=(const Str &) & noexcept = default; explicit operator std::string() const; @@ -157,8 +157,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -171,8 +171,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -442,7 +442,7 @@ template class Box final { explicit Box(const T &); explicit Box(T &&); - Box &operator=(Box &&) &noexcept; + Box &operator=(Box &&) & noexcept; const T *operator->() const noexcept; const T &operator*() const noexcept; @@ -510,7 +510,7 @@ template Box::~Box() noexcept { } } -template Box &Box::operator=(Box &&other) &noexcept { +template Box &Box::operator=(Box &&other) & noexcept { if (this->ptr) { this->drop(); } @@ -585,7 +585,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -651,7 +651,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); @@ -792,7 +792,7 @@ class Error final : public std::exception { ~Error() noexcept override; Error &operator=(const Error &) &; - Error &operator=(Error &&) &noexcept; + Error &operator=(Error &&) & noexcept; const char *what() const noexcept override; @@ -1387,6 +1387,14 @@ struct Walletconnect2Client final : public ::rust::Opaque { ::rust::Vec<::std::uint8_t> sign_personal_blocking(::rust::String message, ::std::array<::std::uint8_t, 20> address); + + /// verify message + /// + bool + verify_personal_blocking(::rust::String message, + ::rust::Vec<::std::uint8_t> signature_bytes, + ::std::array<::std::uint8_t, 20> user_address); + ::rust::String ping_blocking(::std::uint64_t waitmillis); ::rust::Vec<::std::uint8_t> sign_eip155_transaction_blocking( ::com::crypto::game_sdk::WalletConnectTxEip155 const &info, @@ -1686,6 +1694,12 @@ com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$sign_personal_blocking( ::rust::String *message, ::std::array<::std::uint8_t, 20> *address, ::rust::Vec<::std::uint8_t> *return$) noexcept; +::rust::repr::PtrLen +com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$verify_personal_blocking( + ::com::crypto::game_sdk::Walletconnect2Client &self, + ::rust::String *message, ::rust::Vec<::std::uint8_t> *signature_bytes, + ::std::array<::std::uint8_t, 20> *user_address, bool *return$) noexcept; + ::rust::repr::PtrLen com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$ping_blocking( ::com::crypto::game_sdk::Walletconnect2Client &self, @@ -2221,6 +2235,24 @@ ::rust::Vec<::std::uint8_t> Walletconnect2Client::sign_personal_blocking( return ::std::move(return$.value); } +bool Walletconnect2Client::verify_personal_blocking( + ::rust::String message, ::rust::Vec<::std::uint8_t> signature_bytes, + ::std::array<::std::uint8_t, 20> user_address) { + ::rust::ManuallyDrop<::rust::Vec<::std::uint8_t>> signature_bytes$( + ::std::move(signature_bytes)); + ::rust::ManuallyDrop<::std::array<::std::uint8_t, 20>> user_address$( + ::std::move(user_address)); + ::rust::MaybeUninit return$; + ::rust::repr::PtrLen error$ = + com$crypto$game_sdk$cxxbridge1$Walletconnect2Client$verify_personal_blocking( + *this, &message, &signature_bytes$.value, &user_address$.value, + &return$.value); + if (error$.ptr) { + throw ::rust::impl<::rust::Error>::error(error$); + } + return ::std::move(return$.value); +} + ::rust::String Walletconnect2Client::ping_blocking(::std::uint64_t waitmillis) { ::rust::MaybeUninit<::rust::String> return$; ::rust::repr::PtrLen error$ = diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.h b/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.h index 931cdb4..79576ac 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.h +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/extra-cpp-bindings/src/lib.rs.h @@ -55,8 +55,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -111,7 +111,7 @@ class Str final { Str(const char *); Str(const char *, std::size_t); - Str &operator=(const Str &) &noexcept = default; + Str &operator=(const Str &) & noexcept = default; explicit operator std::string() const; @@ -157,8 +157,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -171,8 +171,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -442,7 +442,7 @@ template class Box final { explicit Box(const T &); explicit Box(T &&); - Box &operator=(Box &&) &noexcept; + Box &operator=(Box &&) & noexcept; const T *operator->() const noexcept; const T &operator*() const noexcept; @@ -510,7 +510,7 @@ template Box::~Box() noexcept { } } -template Box &Box::operator=(Box &&other) &noexcept { +template Box &Box::operator=(Box &&other) & noexcept { if (this->ptr) { this->drop(); } @@ -580,7 +580,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -646,7 +646,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); @@ -1301,6 +1301,14 @@ struct Walletconnect2Client final : public ::rust::Opaque { ::rust::Vec<::std::uint8_t> sign_personal_blocking(::rust::String message, ::std::array<::std::uint8_t, 20> address); + + /// verify message + /// + bool + verify_personal_blocking(::rust::String message, + ::rust::Vec<::std::uint8_t> signature_bytes, + ::std::array<::std::uint8_t, 20> user_address); + ::rust::String ping_blocking(::std::uint64_t waitmillis); ::rust::Vec<::std::uint8_t> sign_eip155_transaction_blocking( ::com::crypto::game_sdk::WalletConnectTxEip155 const &info, diff --git a/Source/ThirdParty/PlayCppSdkLibrary/Include/rust/cxx.h b/Source/ThirdParty/PlayCppSdkLibrary/Include/rust/cxx.h index 1af8a6e..f2084bc 100644 --- a/Source/ThirdParty/PlayCppSdkLibrary/Include/rust/cxx.h +++ b/Source/ThirdParty/PlayCppSdkLibrary/Include/rust/cxx.h @@ -52,8 +52,8 @@ class String final { static String lossy(const char16_t *) noexcept; static String lossy(const char16_t *, std::size_t) noexcept; - String &operator=(const String &) &noexcept; - String &operator=(String &&) &noexcept; + String &operator=(const String &) & noexcept; + String &operator=(String &&) & noexcept; explicit operator std::string() const; @@ -112,7 +112,7 @@ class Str final { Str(const char *); Str(const char *, std::size_t); - Str &operator=(const Str &) &noexcept = default; + Str &operator=(const Str &) & noexcept = default; explicit operator std::string() const; @@ -159,8 +159,8 @@ template <> struct copy_assignable_if { copy_assignable_if() noexcept = default; copy_assignable_if(const copy_assignable_if &) noexcept = default; copy_assignable_if & - operator=(const copy_assignable_if &) &noexcept = delete; - copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default; + operator=(const copy_assignable_if &) & noexcept = delete; + copy_assignable_if &operator=(copy_assignable_if &&) & noexcept = default; }; } // namespace detail @@ -174,8 +174,8 @@ class Slice final Slice() noexcept; Slice(T *, std::size_t count) noexcept; - Slice &operator=(const Slice &) &noexcept = default; - Slice &operator=(Slice &&) &noexcept = default; + Slice &operator=(const Slice &) & noexcept = default; + Slice &operator=(Slice &&) & noexcept = default; T *data() const noexcept; std::size_t size() const noexcept; @@ -261,7 +261,7 @@ template class Box final { explicit Box(const T &); explicit Box(T &&); - Box &operator=(Box &&) &noexcept; + Box &operator=(Box &&) & noexcept; const T *operator->() const noexcept; const T &operator*() const noexcept; @@ -304,7 +304,7 @@ template class Vec final { Vec(Vec &&) noexcept; ~Vec() noexcept; - Vec &operator=(Vec &&) &noexcept; + Vec &operator=(Vec &&) & noexcept; Vec &operator=(const Vec &) &; std::size_t size() const noexcept; @@ -382,7 +382,7 @@ class Error final : public std::exception { ~Error() noexcept override; Error &operator=(const Error &) &; - Error &operator=(Error &&) &noexcept; + Error &operator=(Error &&) & noexcept; const char *what() const noexcept override; @@ -725,7 +725,7 @@ template Box::~Box() noexcept { } } -template Box &Box::operator=(Box &&other) &noexcept { +template Box &Box::operator=(Box &&other) & noexcept { if (this->ptr) { this->drop(); } @@ -794,7 +794,7 @@ template Vec::Vec(Vec &&other) noexcept : repr(other.repr) { template Vec::~Vec() noexcept { this->drop(); } -template Vec &Vec::operator=(Vec &&other) &noexcept { +template Vec &Vec::operator=(Vec &&other) & noexcept { this->drop(); this->repr = other.repr; new (&other) Vec(); @@ -990,7 +990,9 @@ template std::size_t align_of() { return layout::align_of(); } #ifndef CXXBRIDGE1_RELOCATABLE #define CXXBRIDGE1_RELOCATABLE namespace detail { -template struct make_void { using type = void; }; +template struct make_void { + using type = void; +}; template using void_t = typename make_void::type;