diff --git a/contracts/eosio.system/voting.cpp b/contracts/eosio.system/voting.cpp index 9f014b034eb..10e51902310 100644 --- a/contracts/eosio.system/voting.cpp +++ b/contracts/eosio.system/voting.cpp @@ -80,7 +80,13 @@ namespace eosiosystem { for ( auto it = idx.cbegin(); it != idx.cend() && top_producers.size() < 21 && 0 < it->total_votes; ++it ) { if( !it->active() ) continue; - if ( it->time_became_active.slot == 0 ) { + /** + If it's the first time or it's been over a day since a producer was last voted in, + update his info. Otherwise, a producer gets a grace period of 7 hours after which + he gets deactivated if he hasn't produced in 24 hours. + */ + if ( it->time_became_active.slot == 0 || + block_time.slot > it->time_became_active.slot + blocks_per_day ) { _producers.modify( *it, 0, [&](auto& p) { p.time_became_active = block_time; }); @@ -92,6 +98,10 @@ namespace eosiosystem { }); continue; + } else { + _producers.modify( *it, 0, [&](auto& p) { + p.time_became_active = block_time; + }); } top_producers.emplace_back( std::pair({{it->owner, it->producer_key}, it->location})); diff --git a/plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp b/plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp index ac16f67da0b..20212a2b7e4 100644 --- a/plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp +++ b/plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp @@ -73,7 +73,7 @@ struct txn_test_gen_plugin_impl { void create_test_accounts(const std::string& init_name, const std::string& init_priv_key) { name newaccountA("txn.test.a"); name newaccountB("txn.test.b"); - name newaccountC("eosio.token"); + name newaccountC("txn.test.t"); name creator(init_name); abi_def currency_abi_def = fc::json::from_string(eosio_token_abi).as(); @@ -109,7 +109,7 @@ struct txn_test_gen_plugin_impl { trx.actions.emplace_back(vector{{creator,"active"}}, newaccount{creator, newaccountB, owner_auth, active_auth}); } - //create "eosio.token" account + //create "txn.test.t" account { auto owner_auth = eosio::chain::authority{1, {{txn_text_receiver_C_pub_key, 1}}, {}}; auto active_auth = eosio::chain::authority{1, {{txn_text_receiver_C_pub_key, 1}}, {}}; @@ -123,7 +123,7 @@ struct txn_test_gen_plugin_impl { push_transaction(trx); } - //set eosio.token contract & initialize it + //set txn.test.t contract to eosio.token & initialize it { signed_transaction trx; @@ -144,34 +144,34 @@ struct txn_test_gen_plugin_impl { { action act; - act.account = N(eosio.token); + act.account = N(txn.test.t); act.name = N(create); act.authorization = vector{{newaccountC,config::active_name}}; - act.data = eosio_token_serializer.variant_to_binary("create", fc::json::from_string("{\"issuer\":\"eosio.token\",\"maximum_supply\":\"1000000000.0000 CUR\"}}")); + act.data = eosio_token_serializer.variant_to_binary("create", fc::json::from_string("{\"issuer\":\"txn.test.t\",\"maximum_supply\":\"1000000000.0000 CUR\"}}")); trx.actions.push_back(act); } { action act; - act.account = N(eosio.token); + act.account = N(txn.test.t); act.name = N(issue); act.authorization = vector{{newaccountC,config::active_name}}; - act.data = eosio_token_serializer.variant_to_binary("issue", fc::json::from_string("{\"to\":\"eosio.token\",\"quantity\":\"600.0000 CUR\",\"memo\":\"\"}")); + act.data = eosio_token_serializer.variant_to_binary("issue", fc::json::from_string("{\"to\":\"txn.test.t\",\"quantity\":\"600.0000 CUR\",\"memo\":\"\"}")); trx.actions.push_back(act); } { action act; - act.account = N(eosio.token); + act.account = N(txn.test.t); act.name = N(transfer); act.authorization = vector{{newaccountC,config::active_name}}; - act.data = eosio_token_serializer.variant_to_binary("transfer", fc::json::from_string("{\"from\":\"eosio.token\",\"to\":\"txn.test.a\",\"quantity\":\"200.0000 CUR\",\"memo\":\"\"}")); + act.data = eosio_token_serializer.variant_to_binary("transfer", fc::json::from_string("{\"from\":\"txn.test.t\",\"to\":\"txn.test.a\",\"quantity\":\"200.0000 CUR\",\"memo\":\"\"}")); trx.actions.push_back(act); } { action act; - act.account = N(eosio.token); + act.account = N(txn.test.t); act.name = N(transfer); act.authorization = vector{{newaccountC,config::active_name}}; - act.data = eosio_token_serializer.variant_to_binary("transfer", fc::json::from_string("{\"from\":\"eosio.token\",\"to\":\"txn.test.b\",\"quantity\":\"200.0000 CUR\",\"memo\":\"\"}")); + act.data = eosio_token_serializer.variant_to_binary("transfer", fc::json::from_string("{\"from\":\"txn.test.t\",\"to\":\"txn.test.b\",\"quantity\":\"200.0000 CUR\",\"memo\":\"\"}")); trx.actions.push_back(act); } @@ -196,12 +196,12 @@ struct txn_test_gen_plugin_impl { running = true; //create the actions here - act_a_to_b.account = N(eosio.token); + act_a_to_b.account = N(txn.test.t); act_a_to_b.name = N(transfer); act_a_to_b.authorization = vector{{name("txn.test.a"),config::active_name}}; act_a_to_b.data = eosio_token_serializer.variant_to_binary("transfer", fc::json::from_string(fc::format_string("{\"from\":\"txn.test.a\",\"to\":\"txn.test.b\",\"quantity\":\"1.0000 CUR\",\"memo\":\"${l}\"}", fc::mutable_variant_object()("l", salt)))); - act_b_to_a.account = N(eosio.token); + act_b_to_a.account = N(txn.test.t); act_b_to_a.name = N(transfer); act_b_to_a.authorization = vector{{name("txn.test.b"),config::active_name}}; act_b_to_a.data = eosio_token_serializer.variant_to_binary("transfer", fc::json::from_string(fc::format_string("{\"from\":\"txn.test.b\",\"to\":\"txn.test.a\",\"quantity\":\"1.0000 CUR\",\"memo\":\"${l}\"}", fc::mutable_variant_object()("l", salt)))); diff --git a/tutorials/bios-boot-tutorial/bios-boot-tutorial.py b/tutorials/bios-boot-tutorial/bios-boot-tutorial.py index a8fb0e58476..0f85d2e7cad 100755 --- a/tutorials/bios-boot-tutorial/bios-boot-tutorial.py +++ b/tutorials/bios-boot-tutorial/bios-boot-tutorial.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import argparse import json import numpy import os @@ -14,14 +15,14 @@ unlockTimeout = 99999999999 nodesDir = './nodes/' contractsDir = '../../build/contracts/' -cleos = 'cleos --wallet-url http://localhost:6666 --url http://localhost:8000 ' +cleos = 'cleos --wallet-url http://localhost:6666 ' nodeos = 'nodeos' fastUnstakeSystem = './fast.refund/eosio.system/eosio.system.wasm' logFile = open('test.log', 'a') symbol = 'SYS' maxUserKeys = 10 # Maximum user keys to import into wallet -minProducerStake = 20.0000 # Minimum producer CPU and BW stake +minProducerStake = 200.0000 # Minimum producer CPU and BW stake extraIssue = 10.0000 # Extra amount to issue to cover buying ram limitUsers = 0 # Limit number of users if >0 limitProducers = 0 # Limit number of producers if >0 @@ -60,15 +61,15 @@ def jsonArg(a): return " '" + json.dumps(a) + "' " def run(args): - print('test.py:', args) + print('bios-boot-tutorial.py:', args) logFile.write(args + '\n') if subprocess.call(args, shell=True): - print('test.py: exiting because of error') + print('bios-boot-tutorial.py: exiting because of error') sys.exit(1) def retry(args): while True: - print('test.py:', args) + print('bios-boot-tutorial.py:', args) logFile.write(args + '\n') if subprocess.call(args, shell=True): print('*** Retry') @@ -76,18 +77,18 @@ def retry(args): break def background(args): - print('test.py:', args) + print('bios-boot-tutorial.py:', args) logFile.write(args + '\n') return subprocess.Popen(args, shell=True) def getOutput(args): - print('test.py:', args) + print('bios-boot-tutorial.py:', args) logFile.write(args + '\n') proc = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE) return proc.communicate()[0].decode('utf-8') def getJsonOutput(args): - print('test.py:', args) + print('bios-boot-tutorial.py:', args) logFile.write(args + '\n') proc = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE) return json.loads(proc.communicate()[0]) @@ -201,9 +202,11 @@ def vote(b, e): def claimRewards(): table = getJsonOutput(cleos + 'get table eosio eosio producers -l 100') + times = [] for row in table['rows']: if row['unpaid_blocks'] and not row['last_claim_time']: - run(cleos + 'system claimrewards ' + row['owner']) + times.append(getJsonOutput(cleos + 'system claimrewards -j ' + row['owner'])['processed']['elapsed']) + print('Elapsed time for claimrewards:', times) def vote(b, e): for i in range(b, e): @@ -246,15 +249,13 @@ def sendUnstakedFunds(b, e): a = accounts[i] run(cleos + 'transfer eosio ' + a['name'] + ' "10.0000 ' + symbol + '"') -def randomTransfer(b, e, n): - for i in range(n): - for j in range(20): - src = accounts[random.randint(b, e - 1)]['name'] - dest = src - while dest == src: - dest = accounts[random.randint(b, e - 1)]['name'] - run(cleos + 'transfer -f ' + src + ' ' + dest + ' "0.0001 ' + symbol + '"' + ' || true') - sleep(.25) +def randomTransfer(b, e): + for j in range(20): + src = accounts[random.randint(b, e - 1)]['name'] + dest = src + while dest == src: + dest = accounts[random.randint(b, e - 1)]['name'] + run(cleos + 'transfer -f ' + src + ' ' + dest + ' "0.0001 ' + symbol + '"' + ' || true') def msigProposeReplaceSystem(proposer, proposalName): requestedPermissions = [] @@ -295,39 +296,98 @@ def produceNewAccounts(): f.write(' {"name":"%s", "pvt":"%s", "pub":"%s"},\n' % (name, r[1], r[2])) logFile.write('\n\n' + '*' * 80 + '\n\n\n') -run('killall keosd nodeos || true') -sleep(1.5) -startWallet() -importKeys() -startNode(0, {'name': 'eosio', 'pvt': eosioPvt, 'pub': eosioPub}) -sleep(1.5) -createSystemAccounts() -run(cleos + 'set contract eosio.token ' + contractsDir + 'eosio.token/') -run(cleos + 'set contract eosio.msig ' + contractsDir + 'eosio.msig/') -run(cleos + 'push action eosio.token create \'["eosio", "10000000000.0000 %s"]\' -p eosio.token' % (symbol)) -totalAllocation = fillStake(0, len(accounts)) -run(cleos + 'push action eosio.token issue \'["eosio", "%s", "memo"]\' -p eosio' % intToCurrency(totalAllocation)) -sleep(1) -retry(cleos + 'set contract eosio ' + contractsDir + 'eosio.system/') -sleep(1) -run(cleos + 'push action eosio setpriv' + jsonArg(['eosio.msig', 1]) + '-p eosio@active') -createStakedAccounts(0, len(accounts)) -regProducers(firstProducer, firstProducer + numProducers) -sleep(1) -listProducers() -startProducers(firstProducer, firstProducer + numProducers) -sleep(producerSyncDelay) -vote(0, 0 + numVoters) -sleep(1) -listProducers() -sleep(5) -claimRewards() -proxyVotes(0, 0 + numVoters) -resign('eosio', 'eosio.prods') -for a in systemAccounts: - resign(a, 'eosio') -# msigReplaceSystem() -run(cleos + 'push action eosio.token issue \'["eosio", "%d.0000 %s", "memo"]\' -p eosio' % ((len(accounts)) * 10, symbol)) -sendUnstakedFunds(0, numSenders) -randomTransfer(0, numSenders, 8) -run('tail -n 60 ' + nodesDir + '00-eosio/stderr') + +def stepKillAll(): + run('killall keosd nodeos || true') + sleep(1.5) +def stepStartWallet(): + startWallet() + importKeys() +def stepStartBoot(): + startNode(0, {'name': 'eosio', 'pvt': eosioPvt, 'pub': eosioPub}) + sleep(1.5) +def stepInstallSystemContracts(): + run(cleos + 'set contract eosio.token ' + contractsDir + 'eosio.token/') + run(cleos + 'set contract eosio.msig ' + contractsDir + 'eosio.msig/') +def stepCreateTokens(): + run(cleos + 'push action eosio.token create \'["eosio", "10000000000.0000 %s"]\' -p eosio.token' % (symbol)) + totalAllocation = fillStake(0, len(accounts)) + run(cleos + 'push action eosio.token issue \'["eosio", "%s", "memo"]\' -p eosio' % intToCurrency(totalAllocation)) + sleep(1) +def stepSetSystemContract(): + retry(cleos + 'set contract eosio ' + contractsDir + 'eosio.system/') + sleep(1) + run(cleos + 'push action eosio setpriv' + jsonArg(['eosio.msig', 1]) + '-p eosio@active') +def stepCreateStakedAccounts(): + createStakedAccounts(0, len(accounts)) +def stepRegProducers(): + regProducers(firstProducer, firstProducer + numProducers) + sleep(1) + listProducers() +def stepStartProducers(): + startProducers(firstProducer, firstProducer + numProducers) + sleep(producerSyncDelay) +def stepVote(): + vote(0, 0 + numVoters) + sleep(1) + listProducers() + sleep(5) +def stepProxyVotes(): + proxyVotes(0, 0 + numVoters) +def stepResign(): + resign('eosio', 'eosio.prods') + for a in systemAccounts: + resign(a, 'eosio') +def stepIssueUnstaked(): + run(cleos + 'push action eosio.token issue \'["eosio", "%d.0000 %s", "memo"]\' -p eosio' % ((len(accounts)) * 10, symbol)) + sendUnstakedFunds(0, numSenders) +def stepTransfer(): + while True: + randomTransfer(0, numSenders) +def stepLog(): + run('tail -n 60 ' + nodesDir + '00-eosio/stderr') + +commands = [ + ('k', 'kill', stepKillAll, True, "Kill all nodeos and keosd processes"), + ('w', 'wallet', stepStartWallet, True, "Start keosd, create wallet, fill with keys"), + ('b', 'boot', stepStartBoot, True, "Start boot node"), + ('s', 'sys', createSystemAccounts, True, "Create system accounts (eosio.*)"), + ('c', 'contracts', stepInstallSystemContracts, True, "Install system contracts (token, msig)"), + ('t', 'tokens', stepCreateTokens, True, "Create tokens"), + ('S', 'sys-contract', stepSetSystemContract, True, "Set system contract"), + ('T', 'stake', stepCreateStakedAccounts, True, "Create staked accounts"), + ('p', 'reg-prod', stepRegProducers, True, "Register producers"), + ('P', 'start-prod', stepStartProducers, True, "Start producers"), + ('v', 'vote', stepVote, True, "Vote for producers"), + ('R', 'claim', claimRewards, True, "Claim rewards"), + ('x', 'proxy', stepProxyVotes, True, "Proxy votes"), + ('q', 'resign', stepResign, True, "Resign eosio"), + ('m', 'msg-replace', msigReplaceSystem, False, "Replace system contract using msig"), + ('u', 'issue', stepIssueUnstaked, True, "Issue unstaked tokens"), + ('X', 'xfer', stepTransfer, False, "Random transfer tokens (infinite loop)"), + ('l', 'log', stepLog, True, "Show tail of node's log"), +] + +parser = argparse.ArgumentParser() +parser.add_argument('-a', '--all', action='store_true', help="Do everything marked with (*)") +parser.add_argument('-H', '--http-port', type=int, default=8000, help='Http port for cleos') +for (flag, command, function, inAll, help) in commands: + prefix = '' + if inAll: prefix += '*' + if prefix: help = '(' + prefix + ') ' + help + if flag: + parser.add_argument('-' + flag, '--' + command, action='store_true', help=help, dest=command) + else: + parser.add_argument('--' + command, action='store_true', help=help, dest=command) +args = parser.parse_args() + +cleos += '--url http://localhost:%d ' % args.http_port + +haveCommand = False +for (flag, command, function, inAll, help) in commands: + if getattr(args, command) or inAll and args.all: + if function: + haveCommand = True + function() +if not haveCommand: + print('bios-boot-tutorial.py: Tell me what to do. -a does almost everything. -h shows options.') diff --git a/unittests/eosio.system_tests.cpp b/unittests/eosio.system_tests.cpp index 41596809208..bb41e3eda40 100644 --- a/unittests/eosio.system_tests.cpp +++ b/unittests/eosio.system_tests.cpp @@ -46,8 +46,8 @@ BOOST_FIXTURE_TEST_CASE( buysell, eosio_system_tester ) try { transfer( "eosio", "alice1111111", core_from_string("100000000.0000"), "eosio" ); BOOST_REQUIRE_EQUAL( core_from_string("100000998.0050"), get_balance( "alice1111111" ) ); - // alice buys ram for 10000000.0000, 0.5% = 50000.0000 got to ramfee - // after fee 9950000.0000 got to bought bytes + // alice buys ram for 10000000.0000, 0.5% = 50000.0000 go to ramfee + // after fee 9950000.0000 go to bought bytes // when selling back bought bytes, pay 0.5% fee and get back 99.5% of 9950000.0000 = 9900250.0000 // expected account after that is 90000998.0050 + 9900250.0000 = 99901248.0050 with a difference // of order 0.0001 due to rounding errors @@ -1298,7 +1298,6 @@ BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, eosio_system_tester, * boost::uni const double usecs_per_year = secs_per_year * 1000000; const double cont_rate = 4.879/100.; - const asset net = core_from_string("80.0000"); const asset cpu = core_from_string("80.0000"); create_account_with_resources( N(producvotera), config::system_account_name, core_from_string("1.0000"), false, net, cpu ); @@ -1549,7 +1548,14 @@ BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, eosio_system_tester, * boost::uni // wait two more hours, now most producers haven't produced in a day and will // be deactivated - produce_block(fc::seconds(2 * 3600)); + BOOST_REQUIRE_EQUAL(success(), push_action(N(producvotera), N(voteproducer), mvo() + ("voter", "producvotera") + ("proxy", name(0).to_string()) + ("producers", vector(producer_names.begin(), producer_names.begin()+21)) + ) + ); + + produce_block(fc::hours(9)); produce_blocks(8 * 21 * 12); { @@ -1706,8 +1712,6 @@ BOOST_FIXTURE_TEST_CASE(producer_onblock_check, eosio_system_tester) try { create_account_with_resources( N(producvoterb), config::system_account_name, core_from_string("1.0000"), false, large_asset, large_asset ); create_account_with_resources( N(producvoterc), config::system_account_name, core_from_string("1.0000"), false, large_asset, large_asset ); - - // create accounts {defproducera, defproducerb, ..., defproducerz} and register as producers std::vector producer_names; producer_names.reserve('z' - 'a' + 1); @@ -2284,7 +2288,7 @@ BOOST_FIXTURE_TEST_CASE( multiple_namebids, eosio_system_tester ) try { produce_block( fc::days(14) ); produce_block(); - // highest bid is from david for prefd but not bids can be closed yet + // highest bid is from david for prefd but no bids can be closed yet BOOST_REQUIRE_EXCEPTION( create_account_with_resources( N(prefd), N(david) ), fc::exception, fc_assert_exception_message_is( not_closed_message ) ); @@ -2360,6 +2364,110 @@ BOOST_FIXTURE_TEST_CASE( multiple_namebids, eosio_system_tester ) try { } 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"); + const asset cpu = core_from_string("80.0000"); + std::vector voters = { N(producvotera), N(producvoterb), N(producvoterc), N(producvoterd) }; + for (const auto& v: voters) { + create_account_with_resources(v, config::system_account_name, core_from_string("1.0000"), false, net, cpu); + } + + // create accounts {defproducera, defproducerb, ..., defproducerz} and register as producers + std::vector producer_names; + { + producer_names.reserve('z' - 'a' + 1); + const std::string root("defproducer"); + for ( char c = 'a'; c <= 'z'; ++c ) { + producer_names.emplace_back(root + std::string(1, c)); + } + setup_producer_accounts(producer_names); + for (const auto& p: producer_names) { + BOOST_REQUIRE_EQUAL( success(), regproducer(p) ); + produce_blocks(1); + ilog( "------ get pro----------" ); + wdump((p)); + BOOST_TEST(0 == get_producer_info(p)["total_votes"].as()); + } + } + + for (const auto& v: voters) { + transfer( config::system_account_name, v, core_from_string("200000000.0000"), config::system_account_name ); + BOOST_REQUIRE_EQUAL(success(), stake(v, core_from_string("30000000.0000"), core_from_string("30000000.0000")) ); + } + + { + BOOST_REQUIRE_EQUAL(success(), push_action(N(producvotera), N(voteproducer), mvo() + ("voter", "producvotera") + ("proxy", name(0).to_string()) + ("producers", vector(producer_names.begin(), producer_names.begin()+20)) + ) + ); + + BOOST_REQUIRE_EQUAL(success(), push_action(N(producvoterb), N(voteproducer), mvo() + ("voter", "producvoterb") + ("proxy", name(0).to_string()) + ("producers", vector(producer_names.begin(), producer_names.begin()+21)) + ) + ); + + BOOST_REQUIRE_EQUAL(success(), push_action(N(producvoterc), N(voteproducer), mvo() + ("voter", "producvoterc") + ("proxy", name(0).to_string()) + ("producers", vector(producer_names.begin(), producer_names.end())) + ) + ); + } + + // give a chance for everyone to produce blocks + { + produce_blocks(23 * 12 + 20); + bool all_21_produced = true; + for (uint32_t i = 0; i < 21; ++i) { + if (0 == get_producer_info(producer_names[i])["unpaid_blocks"].as()) { + all_21_produced = false; + } + } + bool rest_didnt_produce = true; + for (uint32_t i = 21; i < producer_names.size(); ++i) { + if (0 < get_producer_info(producer_names[i])["unpaid_blocks"].as()) { + rest_didnt_produce = false; + } + } + BOOST_REQUIRE(all_21_produced && rest_didnt_produce); + } + + { + produce_block(fc::hours(7)); + const uint32_t voted_out_index = 20; + const uint32_t new_prod_index = 23; + BOOST_REQUIRE_EQUAL(success(), stake("producvoterd", core_from_string("40000000.0000"), core_from_string("40000000.0000"))); + BOOST_REQUIRE_EQUAL(success(), push_action(N(producvoterd), N(voteproducer), mvo() + ("voter", "producvoterd") + ("proxy", name(0).to_string()) + ("producers", vector{ producer_names[new_prod_index] }) + ) + ); + BOOST_REQUIRE_EQUAL(0, get_producer_info(producer_names[new_prod_index])["unpaid_blocks"].as()); + produce_blocks(4 * 12 * 21); + BOOST_REQUIRE(0 < get_producer_info(producer_names[new_prod_index])["unpaid_blocks"]); + const uint32_t initial_unpaid_blocks = get_producer_info(producer_names[voted_out_index])["unpaid_blocks"].as(); + produce_blocks(2 * 12 * 21); + BOOST_REQUIRE_EQUAL(initial_unpaid_blocks, get_producer_info(producer_names[voted_out_index])["unpaid_blocks"].as()); + produce_block(fc::hours(24)); + BOOST_REQUIRE_EQUAL(success(), push_action(N(producvoterd), N(voteproducer), mvo() + ("voter", "producvoterd") + ("proxy", name(0).to_string()) + ("producers", vector{ producer_names[voted_out_index] }) + ) + ); + produce_blocks(2 * 12 * 21); + BOOST_REQUIRE(fc::crypto::public_key() != fc::crypto::public_key(get_producer_info(producer_names[voted_out_index])["producer_key"].as_string())); + BOOST_REQUIRE_EQUAL(success(), push_action(producer_names[voted_out_index], N(claimrewards), mvo()("owner", producer_names[voted_out_index]))); + } + +} FC_LOG_AND_RETHROW() + BOOST_FIXTURE_TEST_CASE( setparams, eosio_system_tester ) try { //install multisig contract abi_serializer msig_abi_ser = initialize_multisig(); diff --git a/unittests/ram_tests.cpp b/unittests/ram_tests.cpp index 90a9460c62d..ee08d76eb42 100644 --- a/unittests/ram_tests.cpp +++ b/unittests/ram_tests.cpp @@ -40,7 +40,7 @@ BOOST_FIXTURE_TEST_CASE(ram_tests, eosio_system::eosio_system_tester) { try { buyrambytes(N(eosio), N(eosio), 70000); produce_blocks(10); create_account_with_resources(N(testram11111),N(eosio), init_request_bytes); - create_account_with_resources(N(testram22222),N(eosio), init_request_bytes); + create_account_with_resources(N(testram22222),N(eosio), init_request_bytes + 1150); produce_blocks(10); BOOST_REQUIRE_EQUAL( success(), stake( "eosio.stake", "testram11111", core_from_string("10.0000"), core_from_string("5.0000") ) ); produce_blocks(10); @@ -189,7 +189,6 @@ BOOST_FIXTURE_TEST_CASE(ram_tests, eosio_system::eosio_system_tester) { try { fc_exception_message_starts_with("account testram11111 has insufficient ram")); produce_blocks(1); -#if 0 // verify that the new entry is under the allocation bytes limit tester->push_action( N(testram11111), N(setentry), {N(testram11111),N(testram22222)}, mvo() ("payer", "testram22222") @@ -260,7 +259,7 @@ BOOST_FIXTURE_TEST_CASE(ram_tests, eosio_system::eosio_system_tester) { try { ("to", 22) ("size", 1910)); produce_blocks(1); -#endif + } FC_LOG_AND_RETHROW() } BOOST_AUTO_TEST_SUITE_END()