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