# Path: jmbase/jmbase/support.py
# def bintohex(b):
#     """Convert bytes to a hex string"""
#     return binascii.hexlify(b).decode('utf8')


import jmbitcoin as btc
import binascii
import json
import pytest
import os
from jmbase import bintohex
#! /usr/bin/env python
'''Test ECDSA signing and other key operations, including legacy message
signature conversion.'''

testdir = os.path.dirname(os.path.realpath(__file__))
vectors = None

def test_valid_sigs(setup_ecc):
    for v in vectors['vectors']:
        msg, sig, priv = (binascii.unhexlify(
            v[a]) for a in ["msg", "sig", "privkey"])
        res = btc.ecdsa_raw_sign(msg, priv, rawmsg=True)+ b'\x01'
        if not sig == res:

# Path: jmbase/jmbase/support.py
# def bintohex(b):
#     """Convert bytes to a hex string"""
#     return binascii.hexlify(b).decode('utf8')


# Path: jmbitcoin/test/test_ecc_signing.py
import jmbitcoin as btc
import binascii
import json
import pytest
import os
from jmbase import bintohex

#! /usr/bin/env python
'''Test ECDSA signing and other key operations, including legacy message
signature conversion.'''

testdir = os.path.dirname(os.path.realpath(__file__))
vectors = None

def test_valid_sigs(setup_ecc):
    for v in vectors['vectors']:
        msg, sig, priv = (binascii.unhexlify(
            v[a]) for a in ["msg", "sig", "privkey"])
        res = btc.ecdsa_raw_sign(msg, priv, rawmsg=True)+ b'\x01'
        if not sig == res:

            print("failed on sig {} from msg {} with priv {}".format(bintohex(sig), bintohex(msg), bintohex(priv)))