Skip to content

Commit

Permalink
trezor-common version bump & messages regenerated
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Oct 18, 2018
1 parent 6dd0e82 commit e83085e
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 138 deletions.
10 changes: 4 additions & 6 deletions src/trezor/messages/MessageType.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,10 @@
MoneroTransactionSetOutputAck = 512
MoneroTransactionAllOutSetRequest = 513
MoneroTransactionAllOutSetAck = 514
MoneroTransactionMlsagDoneRequest = 515
MoneroTransactionMlsagDoneAck = 516
MoneroTransactionSignInputRequest = 517
MoneroTransactionSignInputAck = 518
MoneroTransactionFinalRequest = 519
MoneroTransactionFinalAck = 520
MoneroTransactionSignInputRequest = 515
MoneroTransactionSignInputAck = 516
MoneroTransactionFinalRequest = 517
MoneroTransactionFinalAck = 518
MoneroKeyImageExportInitRequest = 530
MoneroKeyImageExportInitAck = 531
MoneroKeyImageSyncStepRequest = 532
Expand Down
3 changes: 0 additions & 3 deletions src/trezor/messages/MoneroExportedKeyImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ class MoneroExportedKeyImage(p.MessageType):
def __init__(
self,
iv: bytes = None,
tag: bytes = None,
blob: bytes = None,
) -> None:
self.iv = iv
self.tag = tag
self.blob = blob

@classmethod
def get_fields(cls):
return {
1: ('iv', p.BytesType, 0),
2: ('tag', p.BytesType, 0),
3: ('blob', p.BytesType, 0),
}
6 changes: 3 additions & 3 deletions src/trezor/messages/MoneroOutputEntry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# fmt: off
import protobuf as p

from .MoneroRctKey import MoneroRctKey
from .MoneroRctKeyPublic import MoneroRctKeyPublic


class MoneroOutputEntry(p.MessageType):

def __init__(
self,
idx: int = None,
key: MoneroRctKey = None,
key: MoneroRctKeyPublic = None,
) -> None:
self.idx = idx
self.key = key
Expand All @@ -19,5 +19,5 @@ def __init__(
def get_fields(cls):
return {
1: ('idx', p.UVarintType, 0),
2: ('key', MoneroRctKey, 0),
2: ('key', MoneroRctKeyPublic, 0),
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
import protobuf as p


class MoneroRctKey(p.MessageType):
class MoneroRctKeyPublic(p.MessageType):

def __init__(
self,
dest: bytes = None,
mask: bytes = None,
commitment: bytes = None,
) -> None:
self.dest = dest
self.mask = mask
self.commitment = commitment

@classmethod
def get_fields(cls):
return {
1: ('dest', p.BytesType, 0),
2: ('mask', p.BytesType, 0),
2: ('commitment', p.BytesType, 0),
}
14 changes: 0 additions & 14 deletions src/trezor/messages/MoneroTransactionAllInputsSetRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
# fmt: off
import protobuf as p

from .MoneroTransactionRsigData import MoneroTransactionRsigData


class MoneroTransactionAllInputsSetRequest(p.MessageType):
MESSAGE_WIRE_TYPE = 509

def __init__(
self,
rsig_data: MoneroTransactionRsigData = None,
) -> None:
self.rsig_data = rsig_data

@classmethod
def get_fields(cls):
return {
1: ('rsig_data', MoneroTransactionRsigData, 0),
}
7 changes: 3 additions & 4 deletions src/trezor/messages/MoneroTransactionAllOutSetAck.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import protobuf as p

from .MoneroRingCtSig import MoneroRingCtSig
from .MoneroTransactionRsigData import MoneroTransactionRsigData


class MoneroTransactionAllOutSetAck(p.MessageType):
Expand All @@ -13,19 +12,19 @@ def __init__(
self,
extra: bytes = None,
tx_prefix_hash: bytes = None,
rsig_data: MoneroTransactionRsigData = None,
rv: MoneroRingCtSig = None,
full_message_hash: bytes = None,
) -> None:
self.extra = extra
self.tx_prefix_hash = tx_prefix_hash
self.rsig_data = rsig_data
self.rv = rv
self.full_message_hash = full_message_hash

@classmethod
def get_fields(cls):
return {
1: ('extra', p.BytesType, 0),
2: ('tx_prefix_hash', p.BytesType, 0),
3: ('rsig_data', MoneroTransactionRsigData, 0),
4: ('rv', MoneroRingCtSig, 0),
5: ('full_message_hash', p.BytesType, 0),
}
13 changes: 2 additions & 11 deletions src/trezor/messages/MoneroTransactionData.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ def __init__(
fee: int = None,
account: int = None,
minor_indices: List[int] = None,
is_multisig: bool = None,
exp_tx_prefix_hash: bytes = None,
use_tx_keys: List[bytes] = None,
rsig_data: MoneroTransactionRsigData = None,
integrated_indices: List[int] = None,
) -> None:
Expand All @@ -42,9 +39,6 @@ def __init__(
self.fee = fee
self.account = account
self.minor_indices = minor_indices if minor_indices is not None else []
self.is_multisig = is_multisig
self.exp_tx_prefix_hash = exp_tx_prefix_hash
self.use_tx_keys = use_tx_keys if use_tx_keys is not None else []
self.rsig_data = rsig_data
self.integrated_indices = integrated_indices if integrated_indices is not None else []

Expand All @@ -61,9 +55,6 @@ def get_fields(cls):
8: ('fee', p.UVarintType, 0),
9: ('account', p.UVarintType, 0),
10: ('minor_indices', p.UVarintType, p.FLAG_REPEATED),
11: ('is_multisig', p.BoolType, 0),
12: ('exp_tx_prefix_hash', p.BytesType, 0),
13: ('use_tx_keys', p.BytesType, p.FLAG_REPEATED),
14: ('rsig_data', MoneroTransactionRsigData, 0),
15: ('integrated_indices', p.UVarintType, p.FLAG_REPEATED),
11: ('rsig_data', MoneroTransactionRsigData, 0),
12: ('integrated_indices', p.UVarintType, p.FLAG_REPEATED),
}
2 changes: 1 addition & 1 deletion src/trezor/messages/MoneroTransactionFinalAck.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class MoneroTransactionFinalAck(p.MessageType):
MESSAGE_WIRE_TYPE = 520
MESSAGE_WIRE_TYPE = 518

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion src/trezor/messages/MoneroTransactionFinalRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@


class MoneroTransactionFinalRequest(p.MessageType):
MESSAGE_WIRE_TYPE = 519
MESSAGE_WIRE_TYPE = 517
19 changes: 2 additions & 17 deletions src/trezor/messages/MoneroTransactionInitAck.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,15 @@ class MoneroTransactionInitAck(p.MessageType):

def __init__(
self,
version: int = None,
status: int = None,
in_memory: bool = None,
hmacs: List[bytes] = None,
many_inputs: bool = None,
many_outputs: bool = None,
rsig_data: MoneroTransactionRsigData = None,
) -> None:
self.version = version
self.status = status
self.in_memory = in_memory
self.hmacs = hmacs if hmacs is not None else []
self.many_inputs = many_inputs
self.many_outputs = many_outputs
self.rsig_data = rsig_data

@classmethod
def get_fields(cls):
return {
1: ('version', p.UVarintType, 0),
2: ('status', p.UVarintType, 0),
3: ('in_memory', p.BoolType, 0),
4: ('hmacs', p.BytesType, p.FLAG_REPEATED),
5: ('many_inputs', p.BoolType, 0),
6: ('many_outputs', p.BoolType, 0),
7: ('rsig_data', MoneroTransactionRsigData, 0),
1: ('hmacs', p.BytesType, p.FLAG_REPEATED),
2: ('rsig_data', MoneroTransactionRsigData, 0),
}
19 changes: 0 additions & 19 deletions src/trezor/messages/MoneroTransactionMlsagDoneAck.py

This file was deleted.

7 changes: 0 additions & 7 deletions src/trezor/messages/MoneroTransactionMlsagDoneRequest.py

This file was deleted.

32 changes: 6 additions & 26 deletions src/trezor/messages/MoneroTransactionRsigData.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# fmt: off
import protobuf as p

from .MoneroTransactionDestinationEntry import MoneroTransactionDestinationEntry

if __debug__:
try:
from typing import List
Expand All @@ -15,45 +13,27 @@ class MoneroTransactionRsigData(p.MessageType):

def __init__(
self,
version: int = None,
rsig_type: int = None,
offload_type: int = None,
grouping: List[int] = None,
step: int = None,
operation: int = None,
seed: bytes = None,
mask: bytes = None,
amount: bytes = None,
rsig: bytes = None,
rsig_parts: List[bytes] = None,
outputs: List[MoneroTransactionDestinationEntry] = None,
) -> None:
self.version = version
self.rsig_type = rsig_type
self.offload_type = offload_type
self.grouping = grouping if grouping is not None else []
self.step = step
self.operation = operation
self.seed = seed
self.mask = mask
self.amount = amount
self.rsig = rsig
self.rsig_parts = rsig_parts if rsig_parts is not None else []
self.outputs = outputs if outputs is not None else []

@classmethod
def get_fields(cls):
return {
1: ('version', p.UVarintType, 0),
2: ('rsig_type', p.UVarintType, 0),
3: ('offload_type', p.UVarintType, 0),
4: ('grouping', p.UVarintType, p.FLAG_REPEATED),
5: ('step', p.UVarintType, 0),
6: ('operation', p.UVarintType, 0),
7: ('seed', p.BytesType, 0),
8: ('mask', p.BytesType, 0),
9: ('amount', p.BytesType, 0),
10: ('rsig', p.BytesType, 0),
11: ('rsig_parts', p.BytesType, p.FLAG_REPEATED),
12: ('outputs', MoneroTransactionDestinationEntry, p.FLAG_REPEATED),
1: ('rsig_type', p.UVarintType, 0),
2: ('offload_type', p.UVarintType, 0),
3: ('grouping', p.UVarintType, p.FLAG_REPEATED),
4: ('mask', p.BytesType, 0),
5: ('rsig', p.BytesType, 0),
6: ('rsig_parts', p.BytesType, p.FLAG_REPEATED),
}
12 changes: 6 additions & 6 deletions src/trezor/messages/MoneroTransactionSetInputAck.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ def __init__(
vini_hmac: bytes = None,
pseudo_out: bytes = None,
pseudo_out_hmac: bytes = None,
alpha_enc: bytes = None,
spend_enc: bytes = None,
pseudo_out_alpha: bytes = None,
spend_key: bytes = None,
) -> None:
self.vini = vini
self.vini_hmac = vini_hmac
self.pseudo_out = pseudo_out
self.pseudo_out_hmac = pseudo_out_hmac
self.alpha_enc = alpha_enc
self.spend_enc = spend_enc
self.pseudo_out_alpha = pseudo_out_alpha
self.spend_key = spend_key

@classmethod
def get_fields(cls):
Expand All @@ -29,6 +29,6 @@ def get_fields(cls):
2: ('vini_hmac', p.BytesType, 0),
3: ('pseudo_out', p.BytesType, 0),
4: ('pseudo_out_hmac', p.BytesType, 0),
5: ('alpha_enc', p.BytesType, 0),
6: ('spend_enc', p.BytesType, 0),
5: ('pseudo_out_alpha', p.BytesType, 0),
6: ('spend_key', p.BytesType, 0),
}
5 changes: 1 addition & 4 deletions src/trezor/messages/MoneroTransactionSetInputRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ class MoneroTransactionSetInputRequest(p.MessageType):

def __init__(
self,
version: int = None,
src_entr: MoneroTransactionSourceEntry = None,
) -> None:
self.version = version
self.src_entr = src_entr

@classmethod
def get_fields(cls):
return {
1: ('version', p.UVarintType, 0),
2: ('src_entr', MoneroTransactionSourceEntry, 0),
1: ('src_entr', MoneroTransactionSourceEntry, 0),
}
5 changes: 1 addition & 4 deletions src/trezor/messages/MoneroTransactionSignInputAck.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@


class MoneroTransactionSignInputAck(p.MessageType):
MESSAGE_WIRE_TYPE = 518
MESSAGE_WIRE_TYPE = 516

def __init__(
self,
signature: bytes = None,
cout: bytes = None,
) -> None:
self.signature = signature
self.cout = cout

@classmethod
def get_fields(cls):
return {
1: ('signature', p.BytesType, 0),
2: ('cout', p.BytesType, 0),
}
Loading

0 comments on commit e83085e

Please sign in to comment.