File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
packages/contracts-sdk/src/lib Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -322,6 +322,19 @@ export class LitContracts {
322322 index = 0
323323 ) {
324324 const networkContext = NETWORK_CONTEXT_BY_NETWORK [ network ] ;
325+
326+ if ( ! networkContext ) {
327+ throw new WrongNetworkException (
328+ {
329+ info : {
330+ network,
331+ contractName,
332+ } ,
333+ } ,
334+ `Contract "${ contractName } " not found in network "${ network } ". Did you mean ${ Object . keys ( NETWORK_CONTEXT_BY_NETWORK ) . join ( ', ' ) } ?`
335+ ) ;
336+ }
337+
325338 const networkData = networkContext . data . find ( ( data ) => {
326339 return data . name === contractName ;
327340 } ) ;
@@ -545,13 +558,13 @@ export class LitContracts {
545558
546559 private static async _getContractsFromResolver (
547560 context : LitContractResolverContext ,
548- provider : ethers . providers . StaticJsonRpcProvider ,
561+ signerOrProvider : ethers . Signer | ethers . providers . JsonRpcProvider ,
549562 contractNames ?: ContractName [ ]
550563 ) : Promise < LitContractContext > {
551564 const resolverContract = new ethers . Contract (
552565 context . resolverAddress ,
553566 context . abi ,
554- provider
567+ signerOrProvider
555568 ) ;
556569
557570 const getContract = async function (
You can’t perform that action at this time.
0 commit comments