Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions slot_diff_attest.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,19 @@ def main() -> None:
)

if args.sign:
if Account is None:
print("❌ Signing requires eth_account. Install web3[account] or eth-account."); sys.exit(2)
if Account is None:
print("❌ Signing requires eth_account. Install web3[account] or eth-account.", file=sys.stderr)
sys.exit(2)
pk = os.getenv("PRIVATE_KEY", "").strip()
if pk.startswith("0x"): pk = pk[2:]
if not pk:
print("❌ --sign requested but PRIVATE_KEY env var not set."); sys.exit(2)
sys.exit(2)
try:
acct = Account.from_key(pk)
except Exception as e:
print(f"❌ Invalid PRIVATE_KEY: {e}"); sys.exit(2)

sys.exit(2)
# EIP-191 personal_sign over the keccak of canonical JSON
payload = json.dumps(asdict(att), separators=(",", ":"), sort_keys=True).encode()
msg = encode_defunct(primitive=Web3.keccak(payload))
Expand Down