MCPcopy Create free account
hub / github.com/d1ll0n/stack-packer / generateEqualityFunction

Function generateEqualityFunction

src/code-gen/functions.ts:68–90  ·  view source on GitHub ↗
(struct: AbiStruct)

Source from the content-addressed store, hash-verified

66}
67
68export 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
92export const generateComparisonFunctions = (struct: AbiStruct): CodeGenFunction[] => {
93 return [

Callers 1

Calls 2

buildAssemblyBlockFunction · 0.90
elementaryToTypeDefFunction · 0.90

Tested by

no test coverage detected