Skip to content

Commit

Permalink
Merge pull request #3650 from steemit/fix/unittest_vesting_withdraw_r…
Browse files Browse the repository at this point in the history
…oute

unittest vesting withdraw route
  • Loading branch information
xxo1shine committed Jun 10, 2020
2 parents a58daad + 61b102d commit 5661b3f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
10 changes: 5 additions & 5 deletions libraries/chain/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5162,14 +5162,14 @@ void database::init_hardforks()
FC_ASSERT( STEEM_HARDFORK_0_22 == 22, "Invalid hardfork configuration" );
_hardfork_versions.times[ STEEM_HARDFORK_0_22 ] = fc::time_point_sec( STEEM_HARDFORK_0_22_TIME );
_hardfork_versions.versions[ STEEM_HARDFORK_0_22 ] = STEEM_HARDFORK_0_22_VERSION;
#ifdef IS_TEST_NET
FC_ASSERT( STEEM_HARDFORK_0_23 == 23, "Invalid hardfork configuration" );
_hardfork_versions.times[ STEEM_HARDFORK_0_23 ] = fc::time_point_sec( STEEM_HARDFORK_0_23_TIME );
_hardfork_versions.versions[ STEEM_HARDFORK_0_23 ] = STEEM_HARDFORK_0_23_VERSION;
#endif
FC_ASSERT( STEEM_HARDFORK_0_23 == 23, "Invalid hardfork configuration" );
_hardfork_versions.times[ STEEM_HARDFORK_0_23 ] = fc::time_point_sec( STEEM_HARDFORK_0_23_TIME );
_hardfork_versions.versions[ STEEM_HARDFORK_0_23 ] = STEEM_HARDFORK_0_23_VERSION;
#ifdef IS_TEST_NET
FC_ASSERT( STEEM_HARDFORK_0_24 == 24, "Invalid hardfork configuration" );
_hardfork_versions.times[ STEEM_HARDFORK_0_24 ] = fc::time_point_sec( STEEM_HARDFORK_0_24_TIME );
_hardfork_versions.versions[ STEEM_HARDFORK_0_24 ] = STEEM_HARDFORK_0_24_VERSION;
#endif

const auto& hardforks = get_hardfork_property_object();
FC_ASSERT( hardforks.last_hardfork <= STEEM_NUM_HARDFORKS, "Chain knows of more hardforks than configuration", ("hardforks.last_hardfork",hardforks.last_hardfork)("STEEM_NUM_HARDFORKS",STEEM_NUM_HARDFORKS) );
Expand Down
2 changes: 1 addition & 1 deletion libraries/protocol/hardfork.d/0-preamble.hf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <set>

#ifdef IS_TEST_NET
#define STEEM_NUM_HARDFORKS 23
#define STEEM_NUM_HARDFORKS 24
#else
#define STEEM_NUM_HARDFORKS 23
#endif
2 changes: 0 additions & 2 deletions libraries/protocol/hardfork.d/0_23.hf
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#ifndef STEEM_HARDFORK_0_23
#define STEEM_HARDFORK_0_23 23
// #define STEEM_SMT_HARDFORK STEEM_HARDFORK_0_23
#define STEEM_SMT_HARDFORK 24

#define STEEM_HARDFORK_0_23_TIME 1589983200 // Wed, 20 May 2020 14:00:00 UTC (10:00:00 EDT)

Expand Down
13 changes: 13 additions & 0 deletions libraries/protocol/hardfork.d/0_24.hf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef STEEM_HARDFORK_0_24
#define STEEM_HARDFORK_0_24 24
#define STEEM_SMT_HARDFORK STEEM_HARDFORK_0_24

#ifdef IS_TEST_NET
#define STEEM_HARDFORK_0_24_TIME 1571065200 // Mon, 14 October 2019 11:00:00 EDT
#else
#define STEEM_HARDFORK_0_24_TIME 1597970800 // Future 2020...
#endif

#define STEEM_HARDFORK_0_24_VERSION hardfork_version( 0, 24 )

#endif
2 changes: 1 addition & 1 deletion libraries/protocol/include/steem/protocol/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// This is checked by get_config_check.sh called from Dockerfile

#ifdef IS_TEST_NET
#define STEEM_BLOCKCHAIN_VERSION ( version(0, 23, 0) )
#define STEEM_BLOCKCHAIN_VERSION ( version(0, 24, 0) )

#define STEEM_INIT_PRIVATE_KEY (fc::ecc::private_key::regenerate(fc::sha256::hash(std::string("init_key"))))
#define STEEM_INIT_PUBLIC_KEY_STR (std::string( steem::protocol::public_key_type(STEEM_INIT_PRIVATE_KEY.get_public_key()) ))
Expand Down
1 change: 1 addition & 0 deletions tests/tests/operation_time_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,7 @@ BOOST_AUTO_TEST_CASE( vesting_withdraw_route )
vest( "alice", 1040000 );

auto withdraw_amount = alice.vesting_shares - original_vesting;
withdraw_amount.amount /= 10;

BOOST_TEST_MESSAGE( "Setup vesting withdraw" );
withdraw_vesting_operation wv;
Expand Down

0 comments on commit 5661b3f

Please sign in to comment.