1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

protobuf: drop legacy CopyFrom method

This commit is contained in:
matejcik 2019-03-05 16:28:17 +01:00
parent 97171a85f2
commit 22376bede4
3 changed files with 3 additions and 8 deletions

View File

@ -126,8 +126,7 @@ def sign_tx(client, coin_name, inputs, outputs, details=None, prev_txes=None):
serialized_tx = b""
def copy_tx_meta(tx):
tx_copy = messages.TransactionType()
tx_copy.CopyFrom(tx)
tx_copy = messages.TransactionType(**tx)
# clear fields
tx_copy.inputs_cnt = len(tx.inputs)
tx_copy.inputs = []

View File

@ -165,9 +165,6 @@ class MessageType:
else:
setattr(self, fname, None)
def CopyFrom(self, obj):
self.__dict__ = obj.__dict__.copy()
def ByteSize(self):
data = BytesIO()
dump_message(data, self)

View File

@ -71,11 +71,10 @@ def public_ckd(public_node, n):
if not isinstance(n, list):
raise ValueError("Parameter must be a list")
node = messages.HDNodeType()
node.CopyFrom(public_node)
node = messages.HDNodeType(**public_node)
for i in n:
node.CopyFrom(get_subnode(node, i))
node = get_subnode(node, i)
return node