Open marcusnewton opened 2 years ago
Submitted upstream issue https://github.com/dethcrypto/TypeChain/issues/759
See our utility type to sanitise XOutputStruct
types: https://github.com/beehive-innovation/rain-protocol/blob/bump-typechain-hardhat/utils/types/index.ts#L19-L41
It's difficult to bump
typechain
since we depend on importingXStruct
types to help us type check our config structs in our tests. The latest versions oftypechain
now wrap properties withPromiseOrValue<T>
which is frustrating as we would need toawait
every usage of those properties in our tests, even though there's nothing to await.The other option is somehow extracting only the non-array properties from union types that
typechain
generates, however I'm not sure of how to make TypeScript let us do that.Ideally, however,
typechain
would generate actual interfaces we can use that simply contain struct properties without being wrapped byPromiseOrValue<T>
. Will seek to get this resolved upstream.