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

Add next_key to get_table_rows API #7530

Merged
merged 30 commits into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
621c46e
Expand get_table_rows with more2 field when doing lookup with primary…
Jun 21, 2019
51582b2
Replace fixed_key with fixed_bytes from eosio.cdt
Jun 21, 2019
2c5c158
Expand get_table_rows with more2 field when doing lookup with seconda…
Jun 21, 2019
ca3f64b
Expand get_table_rows with more2 field when doing lookup with seconda…
Jun 21, 2019
c72ca9e
Properly align the input for get_table_rows query with key type i256,…
Jun 21, 2019
89dbac6
Expand get_table_rows with more2 field when doing lookup with seconda…
Jun 21, 2019
2266398
Change the format of the input of get_table_rows query with key type …
Jun 21, 2019
c2e5299
Add unit test for get table
Jun 25, 2019
99f45af
Add comments for get table test
Jun 25, 2019
694610f
Merge branch 'develop' into gh7313
Jun 25, 2019
73bb3af
Update comments
Jun 25, 2019
0657c5d
Move get_table_more2_test from chain_plugin_tests to get_table_tests
Jun 27, 2019
70a2710
Merge branch 'develop' into gh7313
Jun 28, 2019
418c728
Add comments
Jul 2, 2019
6a6398a
Merge branch 'develop' into gh7313
Jul 2, 2019
9a07c68
Merge branch 'develop' into gh7313
Aug 1, 2019
09a9eed
Remove redundant include
Aug 1, 2019
315fb1f
more2 to next_key
Aug 1, 2019
eb0922a
Add row size check for get_table_tests
Aug 2, 2019
d410b2d
Use boost multiprecision uint128_t to convert input
Aug 2, 2019
bc8f793
Merge branch 'develop' into gh7313
Sep 17, 2019
8cba938
Modify from_variant and to_variant of uint128 and int128 to use boost…
Sep 17, 2019
1e6ecb0
User lower precision floating point for float128 next_key
Sep 17, 2019
8d692b2
Update fc libraries
Sep 18, 2019
95135f9
Maintain old behaviour of float128_t variant
Sep 19, 2019
7bb5b69
fix get_table_tests/get_table_next_key_test
arhag Sep 19, 2019
10e4a60
convert_to_type for uint128 is not needed anymore since fc variant is…
Sep 23, 2019
96d9f41
Fix strict alias violation
Sep 23, 2019
c2ba132
Merge branch 'gh7313' of github.com:EOSIO/eos into gh7313
Sep 23, 2019
71a77ba
Update fc to master
Sep 25, 2019
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
3 changes: 2 additions & 1 deletion libraries/chain/abi_serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

using namespace boost;


namespace eosio { namespace chain {

const size_t abi_serializer::max_recursion_depth;
Expand Down Expand Up @@ -75,7 +76,7 @@ namespace eosio { namespace chain {
// TODO: Add proper support for floating point types. For now this is good enough.
built_in_types.emplace("float32", pack_unpack<float>());
built_in_types.emplace("float64", pack_unpack<double>());
built_in_types.emplace("float128", pack_unpack<uint128_t>());
built_in_types.emplace("float128", pack_unpack<float128_t>());

built_in_types.emplace("time_point", pack_unpack<fc::time_point>());
built_in_types.emplace("time_point_sec", pack_unpack<fc::time_point_sec>());
Expand Down
15 changes: 13 additions & 2 deletions libraries/chain/include/eosio/chain/database_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,23 @@ namespace fc {

inline
void to_variant( const float128_t& f, variant& v ) {
v = variant(*reinterpret_cast<const uint128_t*>(&f));
// Assumes platform is little endian and hex representation of 128-bit integer is in little endian order.
const eosio::chain::uint128_t as_bytes = *reinterpret_cast<const eosio::chain::uint128_t*>(&f);
std::string s = "0x";
s.append( to_hex( reinterpret_cast<const char*>(&as_bytes), sizeof(as_bytes) ) );
v = s;
}

inline
void from_variant( const variant& v, float128_t& f ) {
from_variant(v, *reinterpret_cast<uint128_t*>(&f));
// Temporarily hold the binary in uint128_t before casting it to float128_t
eosio::chain::uint128_t temp = 0;
auto s = v.as_string();
FC_ASSERT( s.size() == 2 + 2 * sizeof(temp) && s.find("0x") == 0, "Failure in converting hex data into a float128_t");
auto sz = from_hex( s.substr(2), reinterpret_cast<char*>(&temp), sizeof(temp) );
// Assumes platform is little endian and hex representation of 128-bit integer is in little endian order.
FC_ASSERT( sz == sizeof(temp), "Failure in converting hex data into a float128_t" );
f = *reinterpret_cast<const float128_t*>(&temp);
}

inline
Expand Down
Loading