Skip to content

Commit

Permalink
fix(ct): allow storageLayout.types to be null
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-goldman committed Jan 9, 2024
1 parent 597a066 commit 8fe3fd9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-pandas-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sphinx-labs/contracts': patch
---

Allow `storageLayout.types` to be `null`
2 changes: 1 addition & 1 deletion packages/contracts/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ export interface SolidityStorageLayout {
base?: string
members?: Array<SolidityStorageObj>
}
}
} | null
}
3 changes: 1 addition & 2 deletions packages/contracts/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ const isValidStorageLayout = (storageLayout: any): boolean => {
storageLayout !== null &&
typeof storageLayout === 'object' &&
Array.isArray(storageLayout.storage) &&
typeof storageLayout.types === 'object' &&
storageLayout.types !== null
typeof storageLayout.types === 'object'
)
}

Expand Down

0 comments on commit 8fe3fd9

Please sign in to comment.