(struct: AbiStruct, group: GroupType)
| 77 | } |
| 78 | |
| 79 | buildGroup(struct: AbiStruct, group: GroupType): StructGroup { |
| 80 | const members: AbiStructField[] = [] |
| 81 | for (const member of group.members) { |
| 82 | const field = struct.fields.find((field) => field.name === member.name); |
| 83 | if (!field) throw Error(`Member ${member.name} of group ${group.name} not found in ${struct.name}`); |
| 84 | // Shallow copy because we won't need to modify nested values |
| 85 | const fieldCopy = { ...field } |
| 86 | if (member.coderType) { |
| 87 | fieldCopy.coderType = member.coderType; |
| 88 | } else if (group.coderType) { |
| 89 | fieldCopy.coderType = group.coderType |
| 90 | } |
| 91 | } |
| 92 | const { name, coderType, accessors } = group; |
| 93 | return { name, coderType, accessors, members } |
| 94 | } |
| 95 | |
| 96 | handleType(input: DefinedType): AbiType<true, true> | AbiFunction { |
| 97 | if (input.type == 'EnumDefinition') { |
nothing calls this directly
no outgoing calls
no test coverage detected