Skip to content

Commit 450a176

Browse files
committedJul 23, 2023
Include the missing fragment key and args when no matching Contract method or event is present (#3809).
1 parent b1375f4 commit 450a176

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
 

‎src.ts/contract/contract.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ function buildWrappedMethod<A extends Array<any> = Array<any>, R = any, D extend
251251
const getFragment = function(...args: ContractMethodArgs<A>): FunctionFragment {
252252
const fragment = contract.interface.getFunction(key, args);
253253
assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
254-
operation: "fragment"
254+
operation: "fragment",
255+
info: { key, args }
255256
});
256257
return fragment;
257258
}
@@ -348,7 +349,8 @@ function buildWrappedMethod<A extends Array<any> = Array<any>, R = any, D extend
348349
get: () => {
349350
const fragment = contract.interface.getFunction(key);
350351
assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
351-
operation: "fragment"
352+
operation: "fragment",
353+
info: { key }
352354
});
353355
return fragment;
354356
}
@@ -363,7 +365,8 @@ function buildWrappedEvent<A extends Array<any> = Array<any>>(contract: BaseCont
363365
const fragment = contract.interface.getEvent(key, args);
364366

365367
assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
366-
operation: "fragment"
368+
operation: "fragment",
369+
info: { key, args }
367370
});
368371

369372
return fragment;
@@ -388,7 +391,8 @@ function buildWrappedEvent<A extends Array<any> = Array<any>>(contract: BaseCont
388391
const fragment = contract.interface.getEvent(key);
389392

390393
assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
391-
operation: "fragment"
394+
operation: "fragment",
395+
info: { key }
392396
});
393397

394398
return fragment;

0 commit comments

Comments
 (0)
Please sign in to comment.