You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/tests/test.py

40 lines
1.0 KiB

12 years ago
#!/usr/bin/python
import sys
sys.path = ['../',] + sys.path
12 years ago
import time
from bitkeylib.transport_pipe import PipeTransport
from bitkeylib.transport_serial import SerialTransport
import bitkeylib.bitkey_pb2 as proto
12 years ago
from bitkeylib.client import BitkeyClient
12 years ago
bitkey = BitkeyClient('../../bitkey-python/device.socket', debug=True)
bitkey.open()
bitkey.call(proto.Ping(message='ahoj!'))
bitkey.call(proto.SetMaxFeeKb(maxfee_kb=200000))
bitkey.close()
12 years ago
'''
d = PipeTransport('../bitkey-python/device.socket', is_device=False)
12 years ago
#d = SerialTransport('../../bitkey-python/COM9')
#start = time.time()
#for x in range(1000):
call(proto.Initialize())
call(proto.Ping())
call(proto.GetUUID())
#call(proto.GetEntropy(size=10))
#call(proto.LoadDevice(seed='beyond neighbor scratch swirl embarrass doll cause also stick softly physical nice',
# otp=True, pin='1234', spv=True))
#call(proto.ResetDevice())
call(proto.GetMasterPublicKey(algo=proto.ELECTRUM))
#call(proto.ResetDevice())
'''
12 years ago
#print 10000 / (time.time() - start)