Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
hive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
47
Issues
47
List
Boards
Labels
Service Desk
Milestones
Merge Requests
13
Merge Requests
13
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
hive
hive
Commits
36532b53
Commit
36532b53
authored
Jun 29, 2020
by
Andrzej Lisak
Committed by
Bartek Wrona
Jun 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ABW] behaviour changed from handling of non-rebranded transactions to generation of special error
parent
87b8b9bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
libraries/plugins/apis/condenser_api/condenser_api_legacy_operations.cpp
...ns/apis/condenser_api/condenser_api_legacy_operations.cpp
+2
-0
libraries/plugins/apis/condenser_api/include/hive/plugins/condenser_api/condenser_api_legacy_operations.hpp
...plugins/condenser_api/condenser_api_legacy_operations.hpp
+20
-4
No files found.
libraries/plugins/apis/condenser_api/condenser_api_legacy_operations.cpp
View file @
36532b53
...
...
@@ -5,6 +5,8 @@
namespace
fc
{
bool
obsolete_call_detector
::
enable_obsolete_call_detection
=
true
;
std
::
string
name_from_legacy_type
(
const
std
::
string
&
type_name
)
{
auto
start
=
type_name
.
find
(
LEGACY_PREFIX
);
...
...
libraries/plugins/apis/condenser_api/include/hive/plugins/condenser_api/condenser_api_legacy_operations.hpp
View file @
36532b53
...
...
@@ -1763,18 +1763,31 @@ void old_sv_from_variant( const fc::variant& v, T& sv )
sv
.
visit
(
to_old_static_variant
(
ar
[
1
])
);
}
// allows detection of pre-rebranding calls and special error reaction
// note: that and related code will be removed some time after HF24
// since all nodes and libraries should be updated by then
struct
obsolete_call_detector
{
static
bool
enable_obsolete_call_detection
;
static
void
report_error
()
{
FC_ASSERT
(
false
,
"Obsolete form of transaction detected, update your wallet."
);
}
};
}
#define FC_REFLECT_ALIAS_HANDLER( r, name, elem ) \
else if( strcmp( name, std::make_pair elem .first ) == 0 )
\
this->operator()< Member, Class, member >( std::make_pair elem .second );
|| ( ( strcmp( name, std::make_pair elem .first ) == 0 ) &&
\
( vo.find( std::make_pair elem .second ) != vo.end() ) )
#define FC_REFLECT_ALIASED_NAMES( TYPE, MEMBERS, ALIASES ) \
FC_REFLECT( TYPE, MEMBERS ) \
namespace fc { \
\
template<> \
class from_variant_visitor<TYPE>
\
class from_variant_visitor<TYPE>
: obsolete_call_detector
\
{ \
public: \
from_variant_visitor( const variant_object& _vo, TYPE& v ) :vo( _vo ), val( v ) {} \
...
...
@@ -1785,7 +1798,10 @@ void operator()( const char* name )const
auto itr = vo.find( name ); \
if( itr != vo.end() ) \
from_variant( itr->value(), val.*member ); \
BOOST_PP_SEQ_FOR_EACH( FC_REFLECT_ALIAS_HANDLER, name, ALIASES ) \
else if( enable_obsolete_call_detection && ( false \
BOOST_PP_SEQ_FOR_EACH( FC_REFLECT_ALIAS_HANDLER, name, ALIASES ) \
) ) \
report_error(); \
} \
\
const variant_object& vo; \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment