(abiType: AbiType)
| 87 | * @returns A boolean indicating whether the ABI type is an Option struct. |
| 88 | */ |
| 89 | export 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. |
no outgoing calls
no test coverage detected