diff --git a/CHANGELOG.md b/CHANGELOG.md index a8e0b52d89..a695890f11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ Changes: - Add `.keysAt` & `.entriesAt` to query maps at a specific blockHash +- Contracts identifiers matches on both snake_case and camelCase (consistency) + ## 2.3.1 Oct 19, 2020 diff --git a/packages/api-contract/src/Abi.ts b/packages/api-contract/src/Abi.ts index aedb5f526a..25593761a6 100644 --- a/packages/api-contract/src/Abi.ts +++ b/packages/api-contract/src/Abi.ts @@ -13,7 +13,7 @@ function findMessage (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)}`);