Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qtils outcome #25

Merged
merged 3 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ endif()
include(${CMAKE_CURRENT_LIST_DIR}/cmake/HunterGate.cmake)

HunterGate(
URL https://github.com/qdrvm/hunter/archive/refs/tags/v0.23.257-qdrvm10.tar.gz
SHA1 72b446a4424ba28ea90f9a68a9134b0f8e44b5b2
URL https://github.com/qdrvm/hunter/archive/f7e047b26b7baece6dd195d1010149e606c48ec3.zip
SHA1 be4f7995065c18d4ca894f69f616b367c3237366
)

project(Scale LANGUAGES CXX VERSION 1.1.0)
Expand All @@ -30,6 +30,9 @@ option(BUILD_TESTS "Whether to include the test suite in build" OFF)
hunter_add_package(Boost)
find_package(Boost CONFIG REQUIRED)

hunter_add_package(qtils)
find_package(qtils CONFIG REQUIRED)

add_subdirectory(src)

if (BUILD_TESTS)
Expand Down
2 changes: 1 addition & 1 deletion include/scale/encode_append.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#pragma once

#include <scale/outcome/outcome.hpp>
#include <qtils/outcome.hpp>
#include <scale/types.hpp>

namespace scale {
Expand Down
91 changes: 0 additions & 91 deletions include/scale/outcome/outcome-register.hpp

This file was deleted.

37 changes: 0 additions & 37 deletions include/scale/outcome/outcome.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion include/scale/scale.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <boost/throw_exception.hpp>

#include <scale/enum_traits.hpp>
#include <scale/outcome/outcome.hpp>
#include <qtils/outcome.hpp>
#include <scale/scale_decoder_stream.hpp>
#include <scale/scale_encoder_stream.hpp>

Expand Down
2 changes: 1 addition & 1 deletion include/scale/scale_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#pragma once

#include <scale/outcome/outcome-register.hpp>
#include <qtils/enum_error_code.hpp>

namespace scale {

Expand Down
5 changes: 2 additions & 3 deletions test/util/outcome.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
* EXPECT_OUTCOME_TRUE(val, getResult());
*/
#define EXPECT_OUTCOME_TRUE(val, expr) \
EXPECT_OUTCOME_TRUE_name(BOOST_OUTCOME_TRY_UNIQUE_NAME, val, expr)
EXPECT_OUTCOME_TRUE_name(OUTCOME_UNIQUE, val, expr)

#define _EXPECT_EC(tmp, expr, expected) \
auto &&tmp = expr; \
EXPECT_TRUE(tmp.has_error()); \
EXPECT_EQ(tmp.error(), expected);
#define EXPECT_EC(expr, expected) \
_EXPECT_EC(BOOST_OUTCOME_TRY_UNIQUE_NAME, expr, expected)
#define EXPECT_EC(expr, expected) _EXPECT_EC(OUTCOME_UNIQUE, expr, expected)
Loading