Error in ABI message assertion (#1552)

* combine values

* undefined name
This commit is contained in:
Keith Ingram
2019-11-07 10:47:56 +01:00
committed by Jaco Greeff
parent a52c629ecf
commit 479c742471
+1 -1
View File
@@ -42,7 +42,7 @@ export abstract class Base<ApiType extends ApiTypes> implements ContractBase<Api
: this.abi.abi.contract.messages.findIndex((message): boolean => nameOrIndex === message.name || nameOrIndex === stringCamelCase(message.name))
: 0;
const def = this.abi.abi.contract.messages[index];
assert(!!def, `Attempted to access a contract message that does not exist: ${name}`);
assert(!!def, `Attempted to access a contract message that does not exist: ${typeof nameOrIndex === 'number' ? `index ${nameOrIndex}` : nameOrIndex}`);
const fn = this.abi.messages[def.name] || this.abi.messages[stringCamelCase(def.name)];
return { index, def, fn };