Skip to content

Commit

Permalink
Update packages/abi-coder/src/abi-coder.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Luiz Estácio | stacio.eth <luizstacio@gmail.com>
  • Loading branch information
Cameron Manavian and luizstacio committed Aug 31, 2022
1 parent 2ed3866 commit a3c37ce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/abi-coder/src/abi-coder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ export default class AbiCoder {
obj[component.name] = this.getCoder(component);
return obj;
}, {});
return param.type === OPTION_CODER_TYPE
? new OptionCoder(enumMatch.name, coders)
: new EnumCoder(enumMatch.name, coders);
const isOptionEnum = param.type === OPTION_CODER_TYPE;
if (isOptionEnum) {
return new OptionCoder(enumMatch.name, coders);
}
return new EnumCoder(enumMatch.name, coders);
}

const tupleMatch = tupleRegEx.exec(param.type)?.groups;
Expand Down

0 comments on commit a3c37ce

Please sign in to comment.