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

Method buildGroup

src/parser/index.ts:79–94  ·  view source on GitHub ↗
(struct: AbiStruct, group: GroupType)

Source from the content-addressed store, hash-verified

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') {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected