Skip to content

Commit

Permalink
include blockNumber in INVALID_ARGUMENT error
Browse files Browse the repository at this point in the history
  • Loading branch information
rnons committed Jul 22, 2024
1 parent f7deb70 commit a0ba308
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src.ts/contract/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,16 @@ function buildWrappedMethod<A extends Array<any> = Array<any>, R = any, D extend
assert(canCall(runner), "contract runner does not support calling",
"UNSUPPORTED_OPERATION", { operation: "call" });

const tx = await populateTransaction(...args);
let tx
try {
tx = await populateTransaction(...args);
} catch (e) {
const blockNumber = args.at(-1).blockTag
if (blockNumber) {
(e as any).blockNumber = blockNumber
}
throw e
}

let result = "0x";
try {
Expand Down

0 comments on commit a0ba308

Please sign in to comment.