-
Notifications
You must be signed in to change notification settings - Fork 24
/
altheatest3-to-altheatest4.py
127 lines (107 loc) · 3.63 KB
/
altheatest3-to-altheatest4.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import argparse
import json
import sys
parser = argparse.ArgumentParser(
description="Convert altheatest3 genesis file to altheatest4")
parser.add_argument(
'exported_genesis',
help='exported genesis.json file',
type=argparse.FileType('r'), default=sys.stdin,
)
args = parser.parse_args()
genesis = json.loads(args.exported_genesis.read())
# New genesis time
genesis['genesis_time'] = '2019-08-19T22:00:00Z'
# New chain id
genesis['chain_id'] = 'altheatest4'
# Change deposit amount to 1 ALTG
genesis['app_state']['gov']['deposit_params']['min_deposit'][0]['amount'] = '1000000'
# Change unbonding period to 1 day
genesis['app_state']['staking']['params']['unbonding_time'] = '86400000000000'
accounts = genesis['app_state']['accounts']
def search(list, key, value):
for item in list:
if item[key] == value:
return item
total_new_tokens_minted = 0
def mint_ualtg_for(accounts, address, amount):
global total_new_tokens_minted
total_new_tokens_minted = total_new_tokens_minted + amount
for account in accounts:
if account['address'] == address:
# If the account exists, add coins
account['coins'][0]['amount'] = str(int(
account['coins'][0]['amount']) + amount)
return None
# If the account does not yet exist, create it
accounts.append({
"address": address,
"coins": [
{
"denom": "ualtg",
"amount": str(amount)
}
],
"sequence_number": "1",
"account_number": "0",
"original_vesting": None,
"delegated_free": None,
"delegated_vesting": None,
"start_time": "0",
"end_time": "0"
},)
# rourke750
mint_ualtg_for(
accounts, 'cosmos1l6gf409w0lnnw43k0z0uxewhpj039mjg8ztz5q', 100000000)
# meow
mint_ualtg_for(
accounts, 'cosmos1ftal9qkrvm5vq28my6al3ajsyny46gp97fv0z9', 100000000)
# asoltys
mint_ualtg_for(
accounts, 'cosmos1z6s8unktt0em3cnuw6dakewufmeap0y6m964sv', 100000000)
# xcipher
mint_ualtg_for(
accounts, 'cosmos1q7lmehnlwe9faa53jtq2f2jucwudr2dcrfqv3p', 100000000)
# blitmore
mint_ualtg_for(
accounts, 'cosmos1z8tl0rcp8kz9v3tyra4q44zyg337k7geulkh0f', 100000000)
# novy
mint_ualtg_for(
accounts, 'cosmos1m53wwcst7l4psdh8uph2eq74jmqjx85xh3fss3', 100000000)
# ka4ok
mint_ualtg_for(
accounts, 'cosmos14lsedpygn54ch58sl0rr2dz5jxgasue8tke37p', 100000000)
# dasheng
mint_ualtg_for(
accounts, 'cosmos1mqyutur58fx0pfdtpfh34f62w6x9vk2fnd56qg', 100000000)
# POS-Bakerz
mint_ualtg_for(
accounts, 'cosmos1v0z8fxddwa6ftlfeawuwrq677vgk76v2w3v3mc', 100000000)
# browep
mint_ualtg_for(
accounts, 'cosmos13fkdunuukj0tylpslcqshnz6f6tm9vr0a6drfn', 100000000)
# okeanus
mint_ualtg_for(
accounts, 'cosmos1v5c3v8802wtrw06jakk00smtqyvw99xahug9gl', 100000000)
# Chainflow
mint_ualtg_for(
accounts, 'cosmos1jj7lcjxm43yh43u4m6s83h7f0vc2l8a3jte63w', 100000000)
# y3v63n
mint_ualtg_for(
accounts, 'cosmos1cytt9ru6a48j4un4gn5355lgmqankl0l8e7u49', 100000000)
# UbikCapital
mint_ualtg_for(
accounts, 'cosmos1ymy58lrqvrxwa7mnrtaqfl24dv2c5jm7uyx7y9', 100000000)
# nuevax
mint_ualtg_for(
accounts, 'cosmos170zkcgge9w4vj2zqu2jvx37jlfwr2w8t9hsyy4', 100000000)
# blockshane
mint_ualtg_for(
accounts, 'cosmos1me6xrxj80cp4smrmy2mwaan67spnsen9s0xtg4', 100000000)
# Figment Networks
mint_ualtg_for(
accounts, 'cosmos15at47see52v0rv70q4xqcxwa6dhw6ecurjj44x', 100000000)
# Add new tokens into not_bonded_tokens
genesis['app_state']['staking']['pool']['not_bonded_tokens'] = str(int(
genesis['app_state']['staking']['pool']['not_bonded_tokens']) + total_new_tokens_minted)
print(json.dumps(genesis, indent=True))