MCPcopy Create free account
hub / github.com/AztecProtocol/aztec-packages / isOptionStruct

Function isOptionStruct

yarn-project/stdlib/src/abi/utils.ts:89–97  ·  view source on GitHub ↗
(abiType: AbiType)

Source from the content-addressed store, hash-verified

87 * @returns A boolean indicating whether the ABI type is an Option struct.
88 */
89export function isOptionStruct(abiType: AbiType) {
90 return (
91 abiType.kind === 'struct' &&
92 abiType.path === 'std::option::Option' &&
93 abiType.fields.length === 2 &&
94 abiType.fields[0].name === '_is_some' &&
95 abiType.fields[1].name === '_value'
96 );
97}
98
99/**
100 * Returns whether `null` or `undefined` can be mapped to a valid ABI value for this type.

Callers 5

formatAbiTypeFunction · 0.90
abiTypeToTypescriptFunction · 0.90
encodeArgumentMethod · 0.85
decodeNextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected