(struct: AbiStruct)
| 66 | } |
| 67 | |
| 68 | export const generateEqualityFunction = (struct: AbiStruct): CodeGenFunction => { |
| 69 | const body = buildAssemblyBlock([ |
| 70 | `_equals := eq(a, b)` |
| 71 | ]) |
| 72 | return { |
| 73 | internalType: 'comparison', |
| 74 | name: 'equals', |
| 75 | location: 'internal', |
| 76 | visibility: 'pure', |
| 77 | inputFields: [], |
| 78 | outputFields: [], |
| 79 | inputs: [ |
| 80 | { type: struct, name: 'a', definition: `${struct.name} a`, }, |
| 81 | { type: struct, name: 'b', definition: `${struct.name} b`, }, |
| 82 | ], |
| 83 | outputs: [{ |
| 84 | type: elementaryToTypeDef('bool'), |
| 85 | name: '_equals', |
| 86 | definition: `bool _equals`, |
| 87 | }], |
| 88 | body |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | export const generateComparisonFunctions = (struct: AbiStruct): CodeGenFunction[] => { |
| 93 | return [ |
no test coverage detected