Assume immutable by default
This commit is contained in:
parent
fe30e7e7d8
commit
2237ddee8c
|
@ -11,6 +11,7 @@ import { defaultAbiCoder } from "@ethersproject/abi";
|
||||||
import { BigNumber } from "@ethersproject/bignumber";
|
import { BigNumber } from "@ethersproject/bignumber";
|
||||||
import { arrayify, hexDataSlice, isHexString } from "@ethersproject/bytes";
|
import { arrayify, hexDataSlice, isHexString } from "@ethersproject/bytes";
|
||||||
import useSWR, { useSWRConfig } from "swr";
|
import useSWR, { useSWRConfig } from "swr";
|
||||||
|
import useSWRImmutable from "swr/immutable";
|
||||||
import { getInternalOperations } from "./nodeFunctions";
|
import { getInternalOperations } from "./nodeFunctions";
|
||||||
import {
|
import {
|
||||||
TokenMetas,
|
TokenMetas,
|
||||||
|
@ -714,7 +715,10 @@ export const useHasCode = (
|
||||||
blockTag: BlockTag = "latest"
|
blockTag: BlockTag = "latest"
|
||||||
): boolean | undefined => {
|
): boolean | undefined => {
|
||||||
const fetcher = providerFetcher(provider);
|
const fetcher = providerFetcher(provider);
|
||||||
const { data, error } = useSWR(["ots_hasCode", address, blockTag], fetcher);
|
const { data, error } = useSWRImmutable(
|
||||||
|
["ots_hasCode", address, blockTag],
|
||||||
|
fetcher
|
||||||
|
);
|
||||||
if (error) {
|
if (error) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue