Skip to content
Snippets Groups Projects
Unverified Commit d37e77fd authored by Anthony Martin's avatar Anthony Martin Committed by GitHub
Browse files

Merge pull request #1 from steemit/develop

steem/tinman:develop
parents 7e9b82db cd74294d
No related branches found
No related tags found
1 merge request!2Eclipse Update
......@@ -25,7 +25,7 @@ build
.DS_Store
*.swp
*.swo
*.json
/*.json
*.conf
# Packages
......@@ -56,5 +56,3 @@ build
.Trashes
ehthumbs.db
Thumbs.db
{
"metadata":{
"snapshot:semver":"0.2",
"snapshot:origin_api":"http://calculon.local"
},
"dynamic_global_properties":{
"total_vesting_fund_steem":{
"amount":"196793227573",
"nai":"@@000000021",
"precision":3
}
},
"accounts":[],
"witnesses":[]
}
......@@ -47,7 +47,7 @@ FULL_CONF = {
"STEEM_TEMP_ACCOUNT" : {"name" : "temp"}
}
}
class TxgenTest(unittest.TestCase):
def test_create_system_accounts_bad_args(self):
......@@ -262,3 +262,24 @@ class TxgenTest(unittest.TestCase):
cmd, args = action
self.assertIn('Unsupported snapshot', str(ctx.exception))
def test_build_actions_no_main_accounts_snapshot(self):
system_account_names = ["init-0", "init-1", "init-2", "init-3", "init-4",
"init-5", "init-6", "init-7", "init-8", "init-9", "init-10", "init-11",
"init-12", "init-13", "init-14", "init-15", "init-16", "init-17",
"init-18", "init-19", "init-20", "elect-0", "elect-1", "elect-2",
"elect-3", "elect-4", "elect-5", "elect-6", "elect-7", "elect-8",
"elect-9", "tnman", "porter"]
shutil.copyfile("test-no-main-accounts-snapshot.json", "/tmp/test-no-main-accounts-snapshot.json")
conf = FULL_CONF.copy()
conf["snapshot_file"] = "/tmp/test-no-main-accounts-snapshot.json"
for action in txgen.build_actions(conf):
cmd, args = action
if cmd == "submit_transaction":
for type, value in args["tx"]["operations"]:
if type == 'account_create_operation':
new_account_name = value['new_account_name']
self.assertIn(new_account_name, system_account_names)
......@@ -206,8 +206,16 @@ def get_proportions(account_stats, conf, silent=True):
raise RuntimeError("Increase total_port_balance or decrease min_vesting_per_account")
total_port_vesting = (avail_port_balance * total_vesting_steem) // (total_steem + total_vesting_steem)
total_port_liquid = (avail_port_balance * total_steem) // (total_steem + total_vesting_steem)
vest_conversion_factor = (DENOM * total_port_vesting) // total_vests
steem_conversion_factor = (DENOM * total_port_liquid ) // total_steem
if total_vests == 0:
vest_conversion_factor = 1
else:
vest_conversion_factor = (DENOM * total_port_vesting) // total_vests
if total_steem == 0:
steem_conversion_factor = 1
else:
steem_conversion_factor = (DENOM * total_port_liquid ) // total_steem
if not silent:
print("total_vests:", total_vests)
......
......@@ -47,15 +47,6 @@ def main(argv):
witness_schedule = steemd.database_api.get_witness_schedule(x=None)
witnesses = witness_schedule["current_shuffled_witnesses"]
initminer = config["STEEM_INIT_MINER_NAME"]
if initminer not in witnesses:
print("[√] witnesses: %s not present" % initminer)
passfail.append(PREFLIGHT_GO)
else:
print("[X] witnesses: %s present" % initminer)
passfail.append(PREFLIGHT_NOGO)
scheduled_witnesses = witness_schedule["num_scheduled_witnesses"]
if scheduled_witnesses == config["STEEM_MAX_WITNESSES"]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment