Fix SSZ typo fieldCaseDisciminator (declared in nim-serialization)

This commit is contained in:
Mamy André-Ratsimbazafy 2019-08-24 16:52:58 +02:00
parent 5dc6f60b08
commit ad55889707
No known key found for this signature in database
GPG Key ID: 7B88AD1FE79492E1
1 changed files with 3 additions and 3 deletions

View File

@ -176,8 +176,8 @@ proc fieldInfos*(RecordType: type): seq[tuple[name: string,
isFixed = isFixedSize(FieldType)
fixedSize = when isFixed: fixedPortionSize(FieldType)
else: 0
branchKey = when fieldCaseDisciminator.len == 0: ""
else: fieldCaseDisciminator & ":" & $fieldCaseBranches
branchKey = when fieldCaseDiscriminator.len == 0: ""
else: fieldCaseDiscriminator & ":" & $fieldCaseBranches
fieldSize = when isFixed: fixedSize
else: offsetSize
@ -188,7 +188,7 @@ proc fieldInfos*(RecordType: type): seq[tuple[name: string,
fieldOffset = val[]
val[] += fieldSize
do:
let parentBranch = nestedUnder.getOrDefault(fieldCaseDisciminator, "")
let parentBranch = nestedUnder.getOrDefault(fieldCaseDiscriminator, "")
fieldOffset = offsetInBranch[parentBranch]
offsetInBranch[branchKey] = fieldOffset + fieldSize