bolt-gen: use ordered-dict for fields

Use ordered dict for fields, who's order matters when iterated
through (especially for argument lists).

Reported-By: @mocacinno
This commit is contained in:
lisa neigut 2019-07-23 09:42:14 -05:00 committed by Rusty Russell
parent 918e130448
commit 1044e37fee

View File

@ -18,6 +18,7 @@
# subtypedata,<subtypename>,<fieldname>,<typename>,[<count>]
from argparse import ArgumentParser, REMAINDER
from collections import OrderedDict
import copy
import fileinput
from mako.template import Template
@ -98,7 +99,7 @@ class Field(object):
class FieldSet(object):
def __init__(self):
self.fields = {}
self.fields = OrderedDict()
self.optional_fields = False
self.len_fields = {}