Je suis en train de bosser sur le genesis ǦTest et je m’intéresse à la quantité totale de monnaie en circulation. J’ai un désaccord entre la quantité totale sur le comptes et la masse monétaire annoncée dans le bloc d’export :
⚠️ initial monetary mass 7,192,280,539 does not equal 7,192,255,991
total money on the wallets (excluding treasury): 7,192,171,127
money from ignored wallets moved to treasury: 84,864
Voici à peu près le code de py-g1-migrator
:
afficher le code
def get_wallets_data():
# Get wallets balances data
wallets_data = load_json_url("inputs/wallets.json")
wallets = {}
total_money = 0 # counter
ignored_money = 0 # counter
for wallet in wallets_data:
balance = wallet["value"]["balance"]
# ignore source with unlock conditions
if "&&" in wallet["key"]:
ignored_money += balance
continue
pubkey = wallet["key"].split("(")[1].split(")")[0]
# Remove pubkeys > 32 bytes
# d2meevcahfts2gqmvmrw5hzi25jddikk4nc4u1fkwrau
# afv1d5xa7fcdhcta1bqfq3pwvwem16gw67qj37obgnsv
# dyvfr3fqbs6g1yrktbstzxdkj3n7c5hrqf9buddzne4o
# 11111111111111111111111111111111111111111111
# jUPLL2BgY2QpheWEY3R13edV2Y4tvQMCXjJVM8PGDvyd
# gatrpfmgsuez193bja5snivz3dsvsqn5kcm4ydtpknsy
pubkey_bytes = base58.b58decode(pubkey)
pubkey_lenght = len(pubkey_bytes)
if pubkey_lenght > 32 or balance == 0:
ignored_money += balance
continue
wallets.update({v1_pubkey_to_v2_address(pubkey): int(balance)})
total_money += balance
# add ignored money to treasury
# FIXME get treasury address
wallets["5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z"] = ignored_money
return (wallets, total_money, ignored_money)
# Get wallets data
(wallets, total_money, treasury_money) = get_wallets_data()
# check initial monetary mass
if initial_monetary_mass != total_money + treasury_money:
print(f"⚠️ initial monetary mass {initial_monetary_mass:,} does not equal {total_money + treasury_money:,}")
print(f"total money on the wallets (excluding treasury): {total_money:,}")
print(f"money from ignored wallets moved to treasury: {treasury_money:,}")
Quelles raisons à votre avis pourraient expliquer les 24 548 centimes de junes manquants ? (245 Ğ1)
Est-ce que ça va si je calcule cette différence et l’ajoute au compte treasury?
(pour la v2, cf Total issuance vs monetary mass)