mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-18 19:31:04 +00:00
24 lines
690 B
Python
Executable File
24 lines
690 B
Python
Executable File
#!/usr/bin/env python3
|
|
from glob import glob
|
|
import sys
|
|
|
|
error = False
|
|
|
|
for fn in sorted(glob("messages-*.proto")):
|
|
with open(fn, "rt") as f:
|
|
prefix = fn.split(".")[0][9:].capitalize()
|
|
if prefix in ["Bitcoin", "Bootloader", "Common", "Crypto", "Management"]:
|
|
continue
|
|
if prefix == "Nem":
|
|
prefix = "NEM"
|
|
for line in f:
|
|
line = line.strip().split(" ")
|
|
if line[0] not in ["enum", "message"]:
|
|
continue
|
|
if not line[1].startswith(prefix) and not line[1].startswith("Debug" + prefix):
|
|
print("ERROR:", fn, line[1])
|
|
error = True
|
|
|
|
if error:
|
|
sys.exit(1)
|