1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-27 00:28:10 +00:00

build: use python3 everywhere

This commit is contained in:
Pavol Rusnak 2017-09-25 16:01:22 +02:00
parent 9019ec7e2b
commit ef5f1326dc
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
15 changed files with 20 additions and 15 deletions

View File

@ -29,7 +29,8 @@ addons:
- libudev-dev
install:
- pip install ed25519 pyblake2
- pip3 install scons
- pip3 install ed25519 pyblake2
- pip3 install flake8
- pip3 install pytest
- pip3 install ecdsa mnemonic protobuf requests

View File

@ -8,6 +8,6 @@ class EncryptMessage(p.MessageType):
2: ('message', p.BytesType, 0),
3: ('display_only', p.BoolType, 0),
4: ('address_n', p.UVarintType, p.FLAG_REPEATED),
5: ('coin_name', p.UnicodeType, 0), # default=u'Bitcoin'
5: ('coin_name', p.UnicodeType, 0), # default='Bitcoin'
}
MESSAGE_WIRE_TYPE = 49

View File

@ -6,6 +6,6 @@ class EstimateTxSize(p.MessageType):
FIELDS = {
1: ('outputs_count', p.UVarintType, 0), # required
2: ('inputs_count', p.UVarintType, 0), # required
3: ('coin_name', p.UnicodeType, 0), # default=u'Bitcoin'
3: ('coin_name', p.UnicodeType, 0), # default='Bitcoin'
}
MESSAGE_WIRE_TYPE = 43

View File

@ -6,7 +6,7 @@ from .MultisigRedeemScriptType import MultisigRedeemScriptType
class GetAddress(p.MessageType):
FIELDS = {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('coin_name', p.UnicodeType, 0), # default=u'Bitcoin'
2: ('coin_name', p.UnicodeType, 0), # default='Bitcoin'
3: ('show_display', p.BoolType, 0),
4: ('multisig', MultisigRedeemScriptType, 0),
5: ('script_type', p.UVarintType, 0), # default=0

View File

@ -7,6 +7,6 @@ class GetPublicKey(p.MessageType):
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('ecdsa_curve_name', p.UnicodeType, 0),
3: ('show_display', p.BoolType, 0),
4: ('coin_name', p.UnicodeType, 0), # default=u'Bitcoin'
4: ('coin_name', p.UnicodeType, 0), # default='Bitcoin'
}
MESSAGE_WIRE_TYPE = 11

View File

@ -9,7 +9,7 @@ class LoadDevice(p.MessageType):
2: ('node', HDNodeType, 0),
3: ('pin', p.UnicodeType, 0),
4: ('passphrase_protection', p.BoolType, 0),
5: ('language', p.UnicodeType, 0), # default=u'english'
5: ('language', p.UnicodeType, 0), # default='english'
6: ('label', p.UnicodeType, 0),
7: ('skip_checksum', p.BoolType, 0),
8: ('u2f_counter', p.UVarintType, 0),

View File

@ -7,7 +7,7 @@ class RecoveryDevice(p.MessageType):
1: ('word_count', p.UVarintType, 0),
2: ('passphrase_protection', p.BoolType, 0),
3: ('pin_protection', p.BoolType, 0),
4: ('language', p.UnicodeType, 0), # default=u'english'
4: ('language', p.UnicodeType, 0), # default='english'
5: ('label', p.UnicodeType, 0),
6: ('enforce_wordlist', p.BoolType, 0),
8: ('type', p.UVarintType, 0),

View File

@ -8,7 +8,7 @@ class ResetDevice(p.MessageType):
2: ('strength', p.UVarintType, 0), # default=256
3: ('passphrase_protection', p.BoolType, 0),
4: ('pin_protection', p.BoolType, 0),
5: ('language', p.UnicodeType, 0), # default=u'english'
5: ('language', p.UnicodeType, 0), # default='english'
6: ('label', p.UnicodeType, 0),
7: ('u2f_counter', p.UVarintType, 0),
8: ('skip_backup', p.BoolType, 0),

View File

@ -6,7 +6,7 @@ class SignMessage(p.MessageType):
FIELDS = {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('message', p.BytesType, 0), # required
3: ('coin_name', p.UnicodeType, 0), # default=u'Bitcoin'
3: ('coin_name', p.UnicodeType, 0), # default='Bitcoin'
4: ('script_type', p.UVarintType, 0), # default=0
}
MESSAGE_WIRE_TYPE = 38

View File

@ -6,7 +6,7 @@ class SignTx(p.MessageType):
FIELDS = {
1: ('outputs_count', p.UVarintType, 0), # required
2: ('inputs_count', p.UVarintType, 0), # required
3: ('coin_name', p.UnicodeType, 0), # default=u'Bitcoin'
3: ('coin_name', p.UnicodeType, 0), # default='Bitcoin'
4: ('version', p.UVarintType, 0), # default=1
5: ('lock_time', p.UVarintType, 0), # default=0
}

View File

@ -10,7 +10,7 @@ class SimpleSignTx(p.MessageType):
1: ('inputs', TxInputType, p.FLAG_REPEATED),
2: ('outputs', TxOutputType, p.FLAG_REPEATED),
3: ('transactions', TransactionType, p.FLAG_REPEATED),
4: ('coin_name', p.UnicodeType, 0), # default=u'Bitcoin'
4: ('coin_name', p.UnicodeType, 0), # default='Bitcoin'
5: ('version', p.UVarintType, 0), # default=1
6: ('lock_time', p.UVarintType, 0), # default=0
}

View File

@ -7,6 +7,6 @@ class VerifyMessage(p.MessageType):
1: ('address', p.UnicodeType, 0),
2: ('signature', p.BytesType, 0),
3: ('message', p.BytesType, 0),
4: ('coin_name', p.UnicodeType, 0), # default=u'Bitcoin'
4: ('coin_name', p.UnicodeType, 0), # default='Bitcoin'
}
MESSAGE_WIRE_TYPE = 39

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from __future__ import print_function

View File

@ -1,7 +1,7 @@
#!/bin/bash
CURDIR=$(pwd)
mkdir -p $CURDIR/pb2/
echo > $CURDIR/pb2/__init__.py
touch $CURDIR/pb2/__init__.py
mkdir -p ../src/trezor/messages
@ -17,6 +17,10 @@ for i in types messages storage ; do
protoc --python_out=$CURDIR/pb2/ -I/usr/include -I. $i.proto
done
# hack to make output python 3 compatible
sed -i 's/^import types_pb2/from . import types_pb2/g' $CURDIR/pb2/messages_pb2.py
sed -i 's/^import types_pb2/from . import types_pb2/g' $CURDIR/pb2/storage_pb2.py
for i in types messages storage ; do
# Convert google protobuf library to trezor's internal format
cd $CURDIR

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Converts Google's protobuf python definitions of TREZOR wire messages
# to plain-python objects as used in TREZOR Core and python-trezor