Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

move fc::blob to/from_variant out of libchain to fc #9978

Merged
merged 2 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 0 additions & 11 deletions libraries/chain/include/eosio/chain/database_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,6 @@ namespace fc {
b = eosio::chain::shared_blob(_s.begin(), _s.end(), b.get_allocator());
}

inline
void to_variant( const blob& b, variant& v ) {
v = variant(base64_encode(b.data.data(), b.data.size()));
}

inline
void from_variant( const variant& v, blob& b ) {
string _s = base64_decode(v.as_string());
b.data = std::vector<char>(_s.begin(), _s.end());
}

template<typename T>
void to_variant( const eosio::chain::shared_vector<T>& sv, variant& v ) {
to_variant(std::vector<T>(sv.begin(), sv.end()), v);
Expand Down
2 changes: 1 addition & 1 deletion libraries/fc
Submodule fc updated 1 files
+9 −0 src/variant.cpp