Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Commit

Permalink
vendor: trezor-common version bump & pb sync
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Sep 17, 2018
1 parent 5d81c2a commit ea69c7a
Show file tree
Hide file tree
Showing 29 changed files with 508 additions and 53 deletions.
4 changes: 4 additions & 0 deletions src/trezor/messages/MessageType.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@
StellarManageDataOp = 220
StellarBumpSequenceOp = 221
StellarSignedTx = 230
TronGetAddress = 250
TronAddress = 251
TronSignTx = 252
TronSignedTx = 253
CardanoSignTx = 303
CardanoTxRequest = 304
CardanoGetPublicKey = 305
Expand Down
19 changes: 0 additions & 19 deletions src/trezor/messages/MoneroLiteAck.py

This file was deleted.

25 changes: 0 additions & 25 deletions src/trezor/messages/MoneroLiteRequest.py

This file was deleted.

5 changes: 4 additions & 1 deletion src/trezor/messages/MoneroTransactionRsigData.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class MoneroTransactionRsigData(p.MessageType):
8: ('mask', p.BytesType, 0),
9: ('amount', p.BytesType, 0),
10: ('rsig', p.BytesType, 0),
11: ('outputs', MoneroTransactionDestinationEntry, p.FLAG_REPEATED),
11: ('rsig_parts', p.BytesType, p.FLAG_REPEATED),
12: ('outputs', MoneroTransactionDestinationEntry, p.FLAG_REPEATED),
}

def __init__(
Expand All @@ -38,6 +39,7 @@ def __init__(
mask: bytes = None,
amount: bytes = None,
rsig: bytes = None,
rsig_parts: List[bytes] = None,
outputs: List[MoneroTransactionDestinationEntry] = None,
) -> None:
self.version = version
Expand All @@ -50,4 +52,5 @@ def __init__(
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 []
15 changes: 15 additions & 0 deletions src/trezor/messages/TronAccountUpdateContract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p


class TronAccountUpdateContract(p.MessageType):
FIELDS = {
1: ('account_name', p.UnicodeType, 0),
}

def __init__(
self,
account_name: str = None,
) -> None:
self.account_name = account_name
16 changes: 16 additions & 0 deletions src/trezor/messages/TronAddress.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p


class TronAddress(p.MessageType):
MESSAGE_WIRE_TYPE = 251
FIELDS = {
1: ('address', p.UnicodeType, 0),
}

def __init__(
self,
address: str = None,
) -> None:
self.address = address
50 changes: 50 additions & 0 deletions src/trezor/messages/TronAssetIssueContract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p

from .TronFrozenSupply import TronFrozenSupply

if __debug__:
try:
from typing import List
except ImportError:
List = None # type: ignore


class TronAssetIssueContract(p.MessageType):
FIELDS = {
2: ('name', p.UnicodeType, 0),
3: ('abbr', p.UnicodeType, 0),
4: ('total_supply', p.UVarintType, 0),
5: ('frozen_supply', TronFrozenSupply, p.FLAG_REPEATED),
6: ('trx_num', p.UVarintType, 0),
7: ('num', p.UVarintType, 0),
8: ('start_time', p.UVarintType, 0),
9: ('end_time', p.UVarintType, 0),
10: ('description', p.UnicodeType, 0),
11: ('url', p.UnicodeType, 0),
}

def __init__(
self,
name: str = None,
abbr: str = None,
total_supply: int = None,
frozen_supply: List[TronFrozenSupply] = None,
trx_num: int = None,
num: int = None,
start_time: int = None,
end_time: int = None,
description: str = None,
url: str = None,
) -> None:
self.name = name
self.abbr = abbr
self.total_supply = total_supply
self.frozen_supply = frozen_supply if frozen_supply is not None else []
self.trx_num = trx_num
self.num = num
self.start_time = start_time
self.end_time = end_time
self.description = description
self.url = url
77 changes: 77 additions & 0 deletions src/trezor/messages/TronContract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p

from .TronAccountUpdateContract import TronAccountUpdateContract
from .TronAssetIssueContract import TronAssetIssueContract
from .TronFreezeBalanceContract import TronFreezeBalanceContract
from .TronParticipateAssetIssueContract import TronParticipateAssetIssueContract
from .TronProposalApproveContract import TronProposalApproveContract
from .TronProposalCreateContract import TronProposalCreateContract
from .TronProposalDeleteContract import TronProposalDeleteContract
from .TronTransferAssetContract import TronTransferAssetContract
from .TronTransferContract import TronTransferContract
from .TronUnfreezeAssetContract import TronUnfreezeAssetContract
from .TronUnfreezeBalanceContract import TronUnfreezeBalanceContract
from .TronUpdateAssetContract import TronUpdateAssetContract
from .TronVoteWitnessContract import TronVoteWitnessContract
from .TronWithdrawBalanceContract import TronWithdrawBalanceContract
from .TronWitnessCreateContract import TronWitnessCreateContract
from .TronWitnessUpdateContract import TronWitnessUpdateContract


class TronContract(p.MessageType):
FIELDS = {
1: ('transfer_contract', TronTransferContract, 0),
2: ('transfer_asset_contract', TronTransferAssetContract, 0),
4: ('vote_witness_contract', TronVoteWitnessContract, 0),
5: ('witness_create_contract', TronWitnessCreateContract, 0),
6: ('asset_issue_contract', TronAssetIssueContract, 0),
8: ('witness_update_contract', TronWitnessUpdateContract, 0),
9: ('participate_asset_issue_contract', TronParticipateAssetIssueContract, 0),
10: ('account_update_contract', TronAccountUpdateContract, 0),
11: ('freeze_balance_contract', TronFreezeBalanceContract, 0),
12: ('unfreeze_balance_contract', TronUnfreezeBalanceContract, 0),
13: ('withdraw_balance_contract', TronWithdrawBalanceContract, 0),
14: ('unfreeze_asset_contract', TronUnfreezeAssetContract, 0),
15: ('update_asset_contract', TronUpdateAssetContract, 0),
16: ('proposal_create_contract', TronProposalCreateContract, 0),
17: ('proposal_approve_contract', TronProposalApproveContract, 0),
18: ('proposal_delete_contract', TronProposalDeleteContract, 0),
}

def __init__(
self,
transfer_contract: TronTransferContract = None,
transfer_asset_contract: TronTransferAssetContract = None,
vote_witness_contract: TronVoteWitnessContract = None,
witness_create_contract: TronWitnessCreateContract = None,
asset_issue_contract: TronAssetIssueContract = None,
witness_update_contract: TronWitnessUpdateContract = None,
participate_asset_issue_contract: TronParticipateAssetIssueContract = None,
account_update_contract: TronAccountUpdateContract = None,
freeze_balance_contract: TronFreezeBalanceContract = None,
unfreeze_balance_contract: TronUnfreezeBalanceContract = None,
withdraw_balance_contract: TronWithdrawBalanceContract = None,
unfreeze_asset_contract: TronUnfreezeAssetContract = None,
update_asset_contract: TronUpdateAssetContract = None,
proposal_create_contract: TronProposalCreateContract = None,
proposal_approve_contract: TronProposalApproveContract = None,
proposal_delete_contract: TronProposalDeleteContract = None,
) -> None:
self.transfer_contract = transfer_contract
self.transfer_asset_contract = transfer_asset_contract
self.vote_witness_contract = vote_witness_contract
self.witness_create_contract = witness_create_contract
self.asset_issue_contract = asset_issue_contract
self.witness_update_contract = witness_update_contract
self.participate_asset_issue_contract = participate_asset_issue_contract
self.account_update_contract = account_update_contract
self.freeze_balance_contract = freeze_balance_contract
self.unfreeze_balance_contract = unfreeze_balance_contract
self.withdraw_balance_contract = withdraw_balance_contract
self.unfreeze_asset_contract = unfreeze_asset_contract
self.update_asset_contract = update_asset_contract
self.proposal_create_contract = proposal_create_contract
self.proposal_approve_contract = proposal_approve_contract
self.proposal_delete_contract = proposal_delete_contract
18 changes: 18 additions & 0 deletions src/trezor/messages/TronFreezeBalanceContract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p


class TronFreezeBalanceContract(p.MessageType):
FIELDS = {
1: ('frozen_balance', p.UVarintType, 0),
2: ('frozen_duration', p.UVarintType, 0),
}

def __init__(
self,
frozen_balance: int = None,
frozen_duration: int = None,
) -> None:
self.frozen_balance = frozen_balance
self.frozen_duration = frozen_duration
18 changes: 18 additions & 0 deletions src/trezor/messages/TronFrozenSupply.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p


class TronFrozenSupply(p.MessageType):
FIELDS = {
1: ('frozen_amount', p.UVarintType, 0),
2: ('frozen_days', p.UVarintType, 0),
}

def __init__(
self,
frozen_amount: int = None,
frozen_days: int = None,
) -> None:
self.frozen_amount = frozen_amount
self.frozen_days = frozen_days
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
List = None # type: ignore


class MoneroLiteInitRequest(p.MessageType):
MESSAGE_WIRE_TYPE = 540
class TronGetAddress(p.MessageType):
MESSAGE_WIRE_TYPE = 250
FIELDS = {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
3: ('network_type', p.UVarintType, 0),
2: ('show_display', p.BoolType, 0),
}

def __init__(
self,
address_n: List[int] = None,
network_type: int = None,
show_display: bool = None,
) -> None:
self.address_n = address_n if address_n is not None else []
self.network_type = network_type
self.show_display = show_display
21 changes: 21 additions & 0 deletions src/trezor/messages/TronParticipateAssetIssueContract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p


class TronParticipateAssetIssueContract(p.MessageType):
FIELDS = {
1: ('to_address', p.BytesType, 0),
2: ('asset_name', p.UnicodeType, 0),
3: ('amount', p.UVarintType, 0),
}

def __init__(
self,
to_address: bytes = None,
asset_name: str = None,
amount: int = None,
) -> None:
self.to_address = to_address
self.asset_name = asset_name
self.amount = amount
18 changes: 18 additions & 0 deletions src/trezor/messages/TronProposalApproveContract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p


class TronProposalApproveContract(p.MessageType):
FIELDS = {
1: ('proposal_id', p.UVarintType, 0),
2: ('is_add_approval', p.BoolType, 0),
}

def __init__(
self,
proposal_id: int = None,
is_add_approval: bool = None,
) -> None:
self.proposal_id = proposal_id
self.is_add_approval = is_add_approval
23 changes: 23 additions & 0 deletions src/trezor/messages/TronProposalCreateContract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p

from .TronProposalParameters import TronProposalParameters

if __debug__:
try:
from typing import List
except ImportError:
List = None # type: ignore


class TronProposalCreateContract(p.MessageType):
FIELDS = {
1: ('parameters', TronProposalParameters, p.FLAG_REPEATED),
}

def __init__(
self,
parameters: List[TronProposalParameters] = None,
) -> None:
self.parameters = parameters if parameters is not None else []
15 changes: 15 additions & 0 deletions src/trezor/messages/TronProposalDeleteContract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p


class TronProposalDeleteContract(p.MessageType):
FIELDS = {
1: ('proposal_id', p.UVarintType, 0),
}

def __init__(
self,
proposal_id: int = None,
) -> None:
self.proposal_id = proposal_id
Loading

0 comments on commit ea69c7a

Please sign in to comment.