parent
af93c7299d
commit
a31c118d8e
@ -0,0 +1,10 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class CosiCommit(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('data', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 71
|
@ -0,0 +1,10 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class CosiCommitment(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('commitment', p.BytesType, 0),
|
||||||
|
2: ('pubkey', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 72
|
@ -0,0 +1,12 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class CosiSign(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('data', p.BytesType, 0),
|
||||||
|
3: ('global_commitment', p.BytesType, 0),
|
||||||
|
4: ('global_pubkey', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 73
|
@ -0,0 +1,9 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class CosiSignature(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('signature', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 74
|
@ -0,0 +1,9 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class NEMAddress(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address', p.UnicodeType, 0), # required
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 68
|
@ -0,0 +1,10 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
from .NEMCosignatoryModification import NEMCosignatoryModification
|
||||||
|
|
||||||
|
|
||||||
|
class NEMAggregateModification(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('modifications', NEMCosignatoryModification, p.FLAG_REPEATED),
|
||||||
|
2: ('relative_change', p.Sint32Type, 0),
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class NEMCosignatoryModification(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('type', p.UVarintType, 0),
|
||||||
|
2: ('public_key', p.BytesType, 0),
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class NEMDecryptMessage(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('network', p.UVarintType, 0),
|
||||||
|
3: ('public_key', p.BytesType, 0),
|
||||||
|
4: ('payload', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 75
|
@ -0,0 +1,9 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class NEMDecryptedMessage(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('payload', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 76
|
@ -0,0 +1,11 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class NEMGetAddress(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('network', p.UVarintType, 0),
|
||||||
|
3: ('show_display', p.BoolType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 67
|
@ -0,0 +1,9 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class NEMImportanceTransfer(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('mode', p.UVarintType, 0),
|
||||||
|
2: ('public_key', p.BytesType, 0),
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
from micropython import const
|
||||||
|
|
||||||
|
ImportanceTransfer_Activate = const(1)
|
||||||
|
ImportanceTransfer_Deactivate = const(2)
|
@ -0,0 +1,5 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
from micropython import const
|
||||||
|
|
||||||
|
CosignatoryModification_Add = const(1)
|
||||||
|
CosignatoryModification_Delete = const(2)
|
@ -0,0 +1,10 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class NEMMosaic(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('namespace', p.UnicodeType, 0),
|
||||||
|
2: ('mosaic', p.UnicodeType, 0),
|
||||||
|
3: ('quantity', p.UVarintType, 0),
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
from .NEMMosaicDefinition import NEMMosaicDefinition
|
||||||
|
|
||||||
|
|
||||||
|
class NEMMosaicCreation(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('definition', NEMMosaicDefinition, 0),
|
||||||
|
2: ('sink', p.UnicodeType, 0),
|
||||||
|
3: ('fee', p.UVarintType, 0),
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class NEMMosaicDefinition(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('name', p.UnicodeType, 0),
|
||||||
|
2: ('ticker', p.UnicodeType, 0),
|
||||||
|
3: ('namespace', p.UnicodeType, 0),
|
||||||
|
4: ('mosaic', p.UnicodeType, 0),
|
||||||
|
5: ('divisibility', p.UVarintType, 0),
|
||||||
|
6: ('levy', p.UVarintType, 0),
|
||||||
|
7: ('fee', p.UVarintType, 0),
|
||||||
|
8: ('levy_address', p.UnicodeType, 0),
|
||||||
|
9: ('levy_namespace', p.UnicodeType, 0),
|
||||||
|
10: ('levy_mosaic', p.UnicodeType, 0),
|
||||||
|
11: ('supply', p.UVarintType, 0),
|
||||||
|
12: ('mutable_supply', p.BoolType, 0),
|
||||||
|
13: ('transferable', p.BoolType, 0),
|
||||||
|
14: ('description', p.UnicodeType, 0),
|
||||||
|
15: ('networks', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
from micropython import const
|
||||||
|
|
||||||
|
MosaicLevy_Absolute = const(1)
|
||||||
|
MosaicLevy_Percentile = const(2)
|
@ -0,0 +1,11 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class NEMMosaicSupplyChange(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('namespace', p.UnicodeType, 0),
|
||||||
|
2: ('mosaic', p.UnicodeType, 0),
|
||||||
|
3: ('type', p.UVarintType, 0),
|
||||||
|
4: ('delta', p.UVarintType, 0),
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class NEMProvisionNamespace(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('namespace', p.UnicodeType, 0),
|
||||||
|
2: ('parent', p.UnicodeType, 0),
|
||||||
|
3: ('sink', p.UnicodeType, 0),
|
||||||
|
4: ('fee', p.UVarintType, 0),
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
from .NEMAggregateModification import NEMAggregateModification
|
||||||
|
from .NEMImportanceTransfer import NEMImportanceTransfer
|
||||||
|
from .NEMMosaicCreation import NEMMosaicCreation
|
||||||
|
from .NEMMosaicSupplyChange import NEMMosaicSupplyChange
|
||||||
|
from .NEMProvisionNamespace import NEMProvisionNamespace
|
||||||
|
from .NEMTransactionCommon import NEMTransactionCommon
|
||||||
|
from .NEMTransfer import NEMTransfer
|
||||||
|
|
||||||
|
|
||||||
|
class NEMSignTx(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('transaction', NEMTransactionCommon, 0),
|
||||||
|
2: ('multisig', NEMTransactionCommon, 0),
|
||||||
|
3: ('transfer', NEMTransfer, 0),
|
||||||
|
4: ('cosigning', p.BoolType, 0),
|
||||||
|
5: ('provision_namespace', NEMProvisionNamespace, 0),
|
||||||
|
6: ('mosaic_creation', NEMMosaicCreation, 0),
|
||||||
|
7: ('supply_change', NEMMosaicSupplyChange, 0),
|
||||||
|
8: ('aggregate_modification', NEMAggregateModification, 0),
|
||||||
|
9: ('importance_transfer', NEMImportanceTransfer, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 69
|
@ -0,0 +1,10 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class NEMSignedTx(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('data', p.BytesType, 0),
|
||||||
|
2: ('signature', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 70
|
@ -0,0 +1,5 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
from micropython import const
|
||||||
|
|
||||||
|
SupplyChange_Increase = const(1)
|
||||||
|
SupplyChange_Decrease = const(2)
|
@ -0,0 +1,13 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class NEMTransactionCommon(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('network', p.UVarintType, 0),
|
||||||
|
3: ('timestamp', p.UVarintType, 0),
|
||||||
|
4: ('fee', p.UVarintType, 0),
|
||||||
|
5: ('deadline', p.UVarintType, 0),
|
||||||
|
6: ('signer', p.BytesType, 0),
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
from .NEMMosaic import NEMMosaic
|
||||||
|
|
||||||
|
|
||||||
|
class NEMTransfer(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('recipient', p.UnicodeType, 0),
|
||||||
|
2: ('amount', p.UVarintType, 0),
|
||||||
|
3: ('payload', p.BytesType, 0),
|
||||||
|
4: ('public_key', p.BytesType, 0),
|
||||||
|
5: ('mosaics', NEMMosaic, p.FLAG_REPEATED),
|
||||||
|
}
|
@ -1,21 +0,0 @@
|
|||||||
# Automatically generated by pb2py
|
|
||||||
import protobuf as p
|
|
||||||
from .HDNodeType import HDNodeType
|
|
||||||
|
|
||||||
|
|
||||||
class Storage(p.MessageType):
|
|
||||||
FIELDS = {
|
|
||||||
1: ('version', p.UVarintType, 0), # required
|
|
||||||
2: ('node', HDNodeType, 0),
|
|
||||||
3: ('mnemonic', p.UnicodeType, 0),
|
|
||||||
4: ('passphrase_protection', p.BoolType, 0),
|
|
||||||
5: ('pin_failed_attempts', p.UVarintType, 0),
|
|
||||||
6: ('pin', p.UnicodeType, 0),
|
|
||||||
7: ('language', p.UnicodeType, 0),
|
|
||||||
8: ('label', p.UnicodeType, 0),
|
|
||||||
9: ('imported', p.BoolType, 0),
|
|
||||||
10: ('homescreen', p.BytesType, 0),
|
|
||||||
11: ('u2f_counter', p.UVarintType, 0),
|
|
||||||
12: ('needs_backup', p.BoolType, 0),
|
|
||||||
13: ('flags', p.UVarintType, 0),
|
|
||||||
}
|
|
@ -1,30 +1,32 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
CURDIR=$(pwd)
|
CURDIR=$(pwd)
|
||||||
mkdir -p $CURDIR/pb2/
|
PB2DIR=$CURDIR/pb2
|
||||||
touch $CURDIR/pb2/__init__.py
|
OUTDIR=../src/trezor/messages
|
||||||
|
INDEX=$OUTDIR/wire_types.py
|
||||||
|
|
||||||
mkdir -p ../src/trezor/messages
|
rm -f $OUTDIR/[A-Z]*.py
|
||||||
|
mkdir -p $OUTDIR
|
||||||
|
mkdir -p $PB2DIR
|
||||||
|
touch $PB2DIR/__init__.py
|
||||||
|
|
||||||
INDEX=../src/trezor/messages/wire_types.py
|
|
||||||
rm -f $INDEX
|
rm -f $INDEX
|
||||||
echo '# Automatically generated by pb2py' >> $INDEX
|
echo '# Automatically generated by pb2py' >> $INDEX
|
||||||
echo 'from micropython import const' >> $INDEX
|
echo 'from micropython import const' >> $INDEX
|
||||||
echo '' >> $INDEX
|
echo '' >> $INDEX
|
||||||
|
|
||||||
for i in types messages storage ; do
|
for i in types messages ; do
|
||||||
# Compile .proto files to python2 modules using google protobuf library
|
# Compile .proto files to python2 modules using google protobuf library
|
||||||
cd $CURDIR/../../trezor-common/protob
|
cd $CURDIR/../../trezor-common/protob
|
||||||
protoc --python_out=$CURDIR/pb2/ -I/usr/include -I. $i.proto
|
protoc --python_out=$PB2DIR -I/usr/include -I. $i.proto
|
||||||
done
|
done
|
||||||
|
|
||||||
# hack to make output python 3 compatible
|
# 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/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
|
for i in types messages ; do
|
||||||
# Convert google protobuf library to trezor's internal format
|
# Convert google protobuf library to trezor's internal format
|
||||||
cd $CURDIR
|
cd $CURDIR
|
||||||
./pb2py -m -p $CURDIR -i $INDEX $i ../src/trezor/messages/
|
./pb2py -m -p $CURDIR -i $INDEX $i $OUTDIR
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -rf $CURDIR/pb2/
|
rm -rf $PB2DIR
|
||||||
|
Loading…
Reference in new issue