-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29358 from MetaMask/Version-v12.9.3
Version v12.9.3 RC
- Loading branch information
Showing
24 changed files
with
583 additions
and
78 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
.yarn/patches/@metamask-assets-controllers-patch-d6ed5f8213.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
diff --git a/dist/multicall.cjs b/dist/multicall.cjs | ||
index bf9aa5e86573fc1651f421cc0b64f5af121c3ab2..43a0531ed86cd3ee1774dcda3f990dd40f7f52de 100644 | ||
--- a/dist/multicall.cjs | ||
+++ b/dist/multicall.cjs | ||
@@ -342,9 +342,22 @@ const multicallOrFallback = async (calls, chainId, provider, maxCallsPerMultical | ||
return []; | ||
} | ||
const multicallAddress = MULTICALL_CONTRACT_BY_CHAINID[chainId]; | ||
- return await (multicallAddress | ||
- ? multicall(calls, multicallAddress, provider, maxCallsPerMulticall) | ||
- : fallback(calls, maxCallsParallel)); | ||
+ if (multicallAddress) { | ||
+ try { | ||
+ return await multicall(calls, multicallAddress, provider, maxCallsPerMulticall); | ||
+ } | ||
+ catch (error) { | ||
+ // Fallback only on revert | ||
+ // https://docs.ethers.org/v5/troubleshooting/errors/#help-CALL_EXCEPTION | ||
+ if (!error || | ||
+ typeof error !== 'object' || | ||
+ !('code' in error) || | ||
+ error.code !== 'CALL_EXCEPTION') { | ||
+ throw error; | ||
+ } | ||
+ } | ||
+ } | ||
+ return await fallback(calls, maxCallsParallel); | ||
}; | ||
exports.multicallOrFallback = multicallOrFallback; | ||
//# sourceMappingURL=multicall.cjs.map | ||
\ No newline at end of file | ||
diff --git a/dist/multicall.mjs b/dist/multicall.mjs | ||
index 8fbe0112303d5df1d868e0357a9d31e43a3b6cf9..860dfdbddd813659cb2be5f7faed5d4016db5966 100644 | ||
--- a/dist/multicall.mjs | ||
+++ b/dist/multicall.mjs | ||
@@ -339,8 +339,21 @@ export const multicallOrFallback = async (calls, chainId, provider, maxCallsPerM | ||
return []; | ||
} | ||
const multicallAddress = MULTICALL_CONTRACT_BY_CHAINID[chainId]; | ||
- return await (multicallAddress | ||
- ? multicall(calls, multicallAddress, provider, maxCallsPerMulticall) | ||
- : fallback(calls, maxCallsParallel)); | ||
+ if (multicallAddress) { | ||
+ try { | ||
+ return await multicall(calls, multicallAddress, provider, maxCallsPerMulticall); | ||
+ } | ||
+ catch (error) { | ||
+ // Fallback only on revert | ||
+ // https://docs.ethers.org/v5/troubleshooting/errors/#help-CALL_EXCEPTION | ||
+ if (!error || | ||
+ typeof error !== 'object' || | ||
+ !('code' in error) || | ||
+ error.code !== 'CALL_EXCEPTION') { | ||
+ throw error; | ||
+ } | ||
+ } | ||
+ } | ||
+ return await fallback(calls, maxCallsParallel); | ||
}; | ||
//# sourceMappingURL=multicall.mjs.map | ||
\ No newline at end of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import nanoid from 'nanoid'; | ||
import { nanoid } from 'nanoid'; | ||
import { | ||
CaveatTypes, | ||
RestrictedMethods, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Request and responses are currently untyped. | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
|
||
/** | ||
* Returns a middleware that appends the mainFrameOrigin to request | ||
* | ||
* @param {{ mainFrameOrigin: string }} opts - The middleware options | ||
* @returns {Function} | ||
*/ | ||
|
||
export default function createMainFrameOriginMiddleware({ | ||
mainFrameOrigin, | ||
}: { | ||
mainFrameOrigin: string; | ||
}) { | ||
return function mainFrameOriginMiddleware( | ||
req: any, | ||
_res: any, | ||
next: () => void, | ||
) { | ||
req.mainFrameOrigin = mainFrameOrigin; | ||
next(); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.