Skip to content

Commit 59125a8

Browse files
authored
fix: allow empty structs in v1 anchor to be parsed (#452)
1 parent 57bb158 commit 59125a8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/fuzzy-nails-wait.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@codama/nodes-from-anchor': patch
3+
---
4+
5+
recognize unit structs types from anchor

packages/nodes-from-anchor/src/v01/typeNodes/TypeNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const typeNodeFromAnchorV01 = (idlType: IdlV01Type | IdlV01TypeDefTy): Ty
9292
}
9393

9494
// Struct and Tuple.
95-
if ('kind' in idlType && idlType.kind === 'struct' && 'fields' in idlType) {
95+
if ('kind' in idlType && idlType.kind === 'struct') {
9696
const fields = idlType.fields ?? [];
9797
if (isStructFieldArray(fields)) {
9898
return structTypeNodeFromAnchorV01(idlType);

0 commit comments

Comments
 (0)