Fix unboxed serialization including constructor ID

This only affected FutureSalts, but it's useful that it behaves
the way it should. cc @JuanPotato for spotting the bug.
This commit is contained in:
Lonami Exo 2018-05-22 19:21:01 +02:00
parent fac6b2348b
commit bb0d29bdd5

View File

@ -466,6 +466,12 @@ def _write_arg_to_bytes(builder, arg, args, name=None):
# Else it may be a custom type
builder.write('bytes({})', name)
# If the type is not boxed (i.e. starts with lowercase) we should
# not serialize the constructor ID (so remove its first 4 bytes).
boxed = arg.type[arg.type.find('.') + 1].isupper()
if not boxed:
builder.write('[4:]')
if arg.is_flag:
builder.write(')')
if arg.is_vector: