Skip to content

Commit 64f2cb5

Browse files
committed
fix: Made script clear parameters
1 parent 8da08b9 commit 64f2cb5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

scripts/migrate_with_data.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@
113113
new_dict["app_state"]["auth"]["accounts"].append(i)
114114
break
115115
# limit balances to 5k for all old accounts (genesis accs + alice and bob will have more)
116-
for i in old_dict["app_state"]["bank"]["balances"]:
116+
for i in old_dict["app_state"]["bank"]["balances"]:
117117
if i["address"] == addr:
118118
for idx, coin in enumerate(i["coins"]):
119119
# adjust BPFs
120120
if coin["denom"] == "ubpf":
121-
bpf = 0
121+
bpf = 0
122122
# use real bpf value for genesisAddresses
123123
for acc in genesisAccs:
124124
if acc[0] == addr:
@@ -155,13 +155,18 @@
155155
num_packs = int(entry[1])
156156
for x in range(num_packs):
157157
user["boosterPacks"].append({'dropRatiosPerPack': ['150', '50', '1'], 'raritiesPerPack': ['4', '2', '1'], 'setId': '1', 'timeStamp': '0'})
158-
158+
159159
user["earlyAccess"] = user.get(
160160
"earlyAccess",
161161
{"active": False, "invitedUser": "", "invitedByUser": ""}
162162
) # add earlyAccess
163163
if addr in early_access_addr:
164164
user["earlyAccess"]["active"] = True
165165

166+
for id in new_dict["app_state"]["cardchain"]["encounters"]:
167+
if isinstance(new_dict["app_state"]["cardchain"]["encounters"][id]["parameters"], dict):
168+
new_dict["app_state"]["cardchain"]["encounters"][id]["parameters"] = []
169+
170+
166171
with open(file_path_new, "w") as file:
167172
json.dump(new_dict, file, indent=2)

0 commit comments

Comments
 (0)