kopia lustrzana https://github.com/bugout-dev/dao
Another improvement
rodzic
fe895fcaa7
commit
8066d2a8ca
|
@ -32,6 +32,7 @@ parser.add_argument(
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--recipients-file",
|
"--recipients-file",
|
||||||
type=argparse.FileType("r"),
|
type=argparse.FileType("r"),
|
||||||
|
default=None,
|
||||||
help="(Optional) File containing addresses to mint badges to, one address per line. The addresses in this file are added to the addresses passed with the --recipients argument.",
|
help="(Optional) File containing addresses to mint badges to, one address per line. The addresses in this file are added to the addresses passed with the --recipients argument.",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
@ -63,13 +64,14 @@ recipients_raw = args.recipients
|
||||||
if not recipients_raw:
|
if not recipients_raw:
|
||||||
recipients_raw = []
|
recipients_raw = []
|
||||||
|
|
||||||
with args.recipients_file as ifp:
|
if args.recipients_file:
|
||||||
for line in ifp:
|
with args.recipients_file as ifp:
|
||||||
try:
|
for line in ifp:
|
||||||
parsed_line = web3.toChecksumAddress(line.strip())
|
try:
|
||||||
recipients_raw.append(parsed_line)
|
parsed_line = web3.toChecksumAddress(line.strip())
|
||||||
except Exception:
|
recipients_raw.append(parsed_line)
|
||||||
print(f"Not a valid web3 address: {line.strip()}")
|
except Exception:
|
||||||
|
print(f"Not a valid web3 address: {line.strip()}")
|
||||||
|
|
||||||
recipients = list(set(recipients_raw))
|
recipients = list(set(recipients_raw))
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue