From a06955b38e85ba408eadc889bc64f5d523e142b7 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 11 Jul 2018 18:30:52 -0400 Subject: [PATCH 1/2] Point to correct wasmsdk tag --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 37c721125..4aebc8a61 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The following unpriviledged contract(s) are also part of the system. Dependencies: * [eosio v1.0.8](https://github.com/eosio/eos/tree/v1.0.8) -* [eosio.wasmsdk v1.0](https://github.com/eosio/eosio.wasmsdk/tree/v1.0) +* [eosio.wasmsdk v1.0.0](https://github.com/eosio/eosio.wasmsdk/tree/v1.0.0) To build the contracts and the unit tests: * First, ensure that your __eosio__ is compiled to the core symbol for the EOSIO blockchain that intend to deploy to. From b30a7b3773a4a10a99d0dab1c76c2757ce6ea7c2 Mon Sep 17 00:00:00 2001 From: Anton Perkov Date: Thu, 19 Jul 2018 16:50:41 -0400 Subject: [PATCH 2/2] use lower_bound to find top open bid #21 --- eosio.system/src/producer_pay.cpp | 2 +- tests/eosio.system_tester.hpp | 1 + tests/eosio.system_tests.cpp | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/eosio.system/src/producer_pay.cpp b/eosio.system/src/producer_pay.cpp index 39fe64efc..84e2444ad 100644 --- a/eosio.system/src/producer_pay.cpp +++ b/eosio.system/src/producer_pay.cpp @@ -50,7 +50,7 @@ namespace eosiosystem { if( (timestamp.slot - _gstate.last_name_close.slot) > blocks_per_day ) { name_bid_table bids(_self,_self); auto idx = bids.get_index(); - auto highest = idx.begin(); + auto highest = idx.lower_bound( std::numeric_limits::max()/2 ); if( highest != idx.end() && highest->high_bid > 0 && highest->last_bid_time < (current_time() - useconds_per_day) && diff --git a/tests/eosio.system_tester.hpp b/tests/eosio.system_tester.hpp index 7ce52211c..d2896a39c 100644 --- a/tests/eosio.system_tester.hpp +++ b/tests/eosio.system_tester.hpp @@ -518,6 +518,7 @@ class eosio_system_tester : public TESTER { trx.sign( get_private_key( config::system_account_name, "active" ), control->get_chain_id() ); trx.sign( get_private_key( N(producer1111), "active" ), control->get_chain_id() ); push_transaction( trx ); + produce_block(); } } diff --git a/tests/eosio.system_tests.cpp b/tests/eosio.system_tests.cpp index ac21342b7..b8f5380da 100644 --- a/tests/eosio.system_tests.cpp +++ b/tests/eosio.system_tests.cpp @@ -2367,6 +2367,21 @@ BOOST_FIXTURE_TEST_CASE( multiple_namebids, eosio_system_tester ) try { } FC_LOG_AND_RETHROW() +BOOST_FIXTURE_TEST_CASE( namebid_pending_winner, eosio_system_tester ) try { + cross_15_percent_threshold(); + produce_block( fc::hours(14*24) ); //wait 14 day for name auction activation + transfer( config::system_account_name, N(alice1111111), core_from_string("10000.0000") ); + transfer( config::system_account_name, N(bob111111111), core_from_string("10000.0000") ); + + BOOST_REQUIRE_EQUAL( success(), bidname( "alice1111111", "prefa", core_from_string( "50.0000" ) )); + BOOST_REQUIRE_EQUAL( success(), bidname( "bob111111111", "prefb", core_from_string( "30.0000" ) )); + produce_block( fc::hours(100) ); //should close "perfa" + produce_block( fc::hours(100) ); //should close "perfb" + + //despite "perfa" account hasn't been created, we should be able to create "perfb" account + create_account_with_resources( N(prefb), N(bob111111111) ); +} FC_LOG_AND_RETHROW() + BOOST_FIXTURE_TEST_CASE( vote_producers_in_and_out, eosio_system_tester ) try { const asset net = core_from_string("80.0000");