mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-08-01 11:28:20 +00:00
protobuf: drop legacy CopyFrom method
This commit is contained in:
parent
97171a85f2
commit
22376bede4
@ -126,8 +126,7 @@ def sign_tx(client, coin_name, inputs, outputs, details=None, prev_txes=None):
|
|||||||
serialized_tx = b""
|
serialized_tx = b""
|
||||||
|
|
||||||
def copy_tx_meta(tx):
|
def copy_tx_meta(tx):
|
||||||
tx_copy = messages.TransactionType()
|
tx_copy = messages.TransactionType(**tx)
|
||||||
tx_copy.CopyFrom(tx)
|
|
||||||
# clear fields
|
# clear fields
|
||||||
tx_copy.inputs_cnt = len(tx.inputs)
|
tx_copy.inputs_cnt = len(tx.inputs)
|
||||||
tx_copy.inputs = []
|
tx_copy.inputs = []
|
||||||
|
@ -165,9 +165,6 @@ class MessageType:
|
|||||||
else:
|
else:
|
||||||
setattr(self, fname, None)
|
setattr(self, fname, None)
|
||||||
|
|
||||||
def CopyFrom(self, obj):
|
|
||||||
self.__dict__ = obj.__dict__.copy()
|
|
||||||
|
|
||||||
def ByteSize(self):
|
def ByteSize(self):
|
||||||
data = BytesIO()
|
data = BytesIO()
|
||||||
dump_message(data, self)
|
dump_message(data, self)
|
||||||
|
@ -71,11 +71,10 @@ def public_ckd(public_node, n):
|
|||||||
if not isinstance(n, list):
|
if not isinstance(n, list):
|
||||||
raise ValueError("Parameter must be a list")
|
raise ValueError("Parameter must be a list")
|
||||||
|
|
||||||
node = messages.HDNodeType()
|
node = messages.HDNodeType(**public_node)
|
||||||
node.CopyFrom(public_node)
|
|
||||||
|
|
||||||
for i in n:
|
for i in n:
|
||||||
node.CopyFrom(get_subnode(node, i))
|
node = get_subnode(node, i)
|
||||||
|
|
||||||
return node
|
return node
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user