Match contract ids on camelCase (in addition to original) (#2747)

This commit is contained in:
Jaco Greeff
2020-10-19 20:15:19 +02:00
committed by GitHub
parent 4ea343e369
commit 0525feb6f2
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string
const message = isNumber(messageOrId)
? list[messageOrId]
: isString(messageOrId)
? list.find(({ identifier }: T) => identifier === messageOrId.toString())
? list.find(({ identifier }) => [identifier, stringCamelCase(identifier)].includes(messageOrId.toString()))
: messageOrId;
assert(message, `Attempted to call an invalid contract interface, ${JSON.stringify(messageOrId)}`);