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

Commit

Permalink
xmr: msg dump with prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Sep 13, 2018
1 parent 6e39801 commit 326af13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/apps/monero/controller/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ def parse_vini(bts):
return parse_msg(bts, TxinToKey())


def dump_msg(msg, preallocate=None, msg_type=None):
def dump_msg(msg, preallocate=None, msg_type=None, prefix=None):
from apps.monero.xmr.serialize import xmrserialize
from apps.monero.xmr.serialize.readwriter import MemoryReaderWriter

writer = MemoryReaderWriter(preallocate=preallocate)
if prefix:
writer.write(prefix)
ar = xmrserialize.Archive(writer, True)
ar.message(msg, msg_type=msg_type)
return writer.get_buffer()
Expand Down

0 comments on commit 326af13

Please sign in to comment.