Skip to content

Commit d51e3fb

Browse files
committed
Fixed CCIP read in contract calls (#4043).
1 parent 5210b68 commit d51e3fb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src.ts/providers/abstract-provider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ export class AbstractProvider implements Provider {
939939
try {
940940
return hexlify(await this._perform({ method: "call", transaction, blockTag }));
941941

942-
} catch (error) {
942+
} catch (error: any) {
943943
// CCIP Read OffchainLookup
944944
if (!this.disableCcipRead && isCallException(error) && error.data && attempt >= 0 && blockTag === "latest" && transaction.to != null && dataSlice(error.data, 0, 4) === "0x556f1830") {
945945
const data = error.data;
@@ -1007,6 +1007,7 @@ export class AbstractProvider implements Provider {
10071007
tx: this._getTransactionRequest(_tx),
10081008
blockTag: this._getBlockTag(_tx.blockTag)
10091009
});
1010+
10101011
return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0: -1));
10111012
}
10121013

src.ts/providers/provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ export function copyRequest(req: TransactionRequest): PreparedTransactionRequest
351351
if ("blockTag" in req) { result.blockTag = req.blockTag; }
352352

353353
if ("enableCcipRead" in req) {
354-
result.enableCcipReadEnabled = !!req.enableCcipRead
354+
result.enableCcipRead = !!req.enableCcipRead
355355
}
356356

357357
if ("customData" in req) {

0 commit comments

Comments
 (0)