diff options
Diffstat (limited to 'data/transactions/logic/fields.go')
-rw-r--r-- | data/transactions/logic/fields.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/data/transactions/logic/fields.go b/data/transactions/logic/fields.go index 0a6cb9c96..68ae0f12f 100644 --- a/data/transactions/logic/fields.go +++ b/data/transactions/logic/fields.go @@ -639,7 +639,7 @@ func init() { txnFieldSpecByField = make(map[TxnField]txnFieldSpec, len(TxnFieldNames)) for i, s := range txnFieldSpecs { if int(s.field) != i { - panic("txnFieldTypePairs disjoint with TxnField enum") + panic("txnFieldSpecs disjoint with TxnField enum") } TxnFieldTypes[i] = s.ftype txnFieldSpecByField[s.field] = s @@ -655,8 +655,11 @@ func init() { } GlobalFieldTypes = make([]StackType, len(GlobalFieldNames)) globalFieldSpecByField = make(map[GlobalField]globalFieldSpec, len(GlobalFieldNames)) - for _, s := range globalFieldSpecs { - GlobalFieldTypes[int(s.field)] = s.ftype + for i, s := range globalFieldSpecs { + if int(s.field) != i { + panic("globalFieldSpecs disjoint with GlobalField enum") + } + GlobalFieldTypes[i] = s.ftype globalFieldSpecByField[s.field] = s } globalFieldSpecByName = make(gfNameSpecMap, len(GlobalFieldNames)) |