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:
parent
97171a85f2
commit
22376bede4
@ -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 = []
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user