Skip invalid entries
This commit is contained in:
parent
7292d97674
commit
0be9dd8f90
@ -4,6 +4,7 @@ import pandas as pd
|
|||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import argparse
|
import argparse
|
||||||
|
from bech32 import bech32_decode
|
||||||
|
|
||||||
def get_excel_download_url(google_sheet_url):
|
def get_excel_download_url(google_sheet_url):
|
||||||
"""
|
"""
|
||||||
@ -57,6 +58,13 @@ def convert_excel_to_json(excel_path, json_path, sheet_name):
|
|||||||
if not key or key.lower() == 'nan':
|
if not key or key.lower() == 'nan':
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# If key is the laconic address, validate that it's a valid bech32 address
|
||||||
|
if key == laconic_address:
|
||||||
|
hrp, data = bech32_decode(laconic_address)
|
||||||
|
if hrp is None or data is None or not hrp.startswith("laconic"):
|
||||||
|
print(f"Skipping invalid Laconic address: {laconic_address}")
|
||||||
|
continue
|
||||||
|
|
||||||
entry = {
|
entry = {
|
||||||
'total_lps_allocation': row['Total LPS Allocation'] if not pd.isna(row['Total LPS Allocation']) else None,
|
'total_lps_allocation': row['Total LPS Allocation'] if not pd.isna(row['Total LPS Allocation']) else None,
|
||||||
'lock_months': row['Lock (months)'] if not pd.isna(row['Lock (months)']) else None,
|
'lock_months': row['Lock (months)'] if not pd.isna(row['Lock (months)']) else None,
|
||||||
|
@ -50,7 +50,7 @@ fi
|
|||||||
|
|
||||||
# Activate venv and install dependencies
|
# Activate venv and install dependencies
|
||||||
"$venv_dir/bin/pip" install --upgrade pip
|
"$venv_dir/bin/pip" install --upgrade pip
|
||||||
"$venv_dir/bin/pip" install requests pandas openpyxl
|
"$venv_dir/bin/pip" install requests pandas openpyxl bech32
|
||||||
|
|
||||||
echo "Running LPS lock generation script..."
|
echo "Running LPS lock generation script..."
|
||||||
"$venv_dir/bin/python" "$script_dir/generate-lps-distribution-json.py" \
|
"$venv_dir/bin/python" "$script_dir/generate-lps-distribution-json.py" \
|
||||||
|
Loading…
Reference in New Issue
Block a user