Skip to content

Commit

Permalink
Throw wrong network only when chainId is known already
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementWalter committed Jul 11, 2023
1 parent fecec23 commit ed5e834
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
16 changes: 8 additions & 8 deletions packages/starksheet-cairo/deployments/madara/deployments.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"BasicCellRenderer": {
"address": "0x7aaaf70d3154b71750665b89fd8dd86e79ea7e9f673f2f33a0e3ea025a2bc90",
"tx": "0x4335f368647ba65b1588bd6d71c6a9cfeb40e9b12119dfef0eb8d12531b8227",
"address": "0x6e36cb9f6e580777ac930b1eee10289d5338f662224a4fab28fa162d80ae13e",
"tx": "0x431f51fa1e5c3c1a3471cd17060949460e960858c2718f011a46caf7b5e8cc3",
"artifact": "build/BasicCellRenderer.json",
"alias": "basic_cell_renderer"
},
"math": {
"address": "0x7e28503600cc4533145d53db41fd975a424d198982178c34f1f15870fde281b",
"tx": "0x4e4a10da785f9a0ad6e8ba06a16146563316e550320e13da72512fb83fca38e",
"address": "0x14c96904ebf2f72b3046cd835c9faf6e5914e911dd05e1060dedc980b0058df",
"tx": "0x5c6b1ba65b717e6fb3d9b8f55fdc70b0f40b979456cdf9266f21ef84cd59665",
"artifact": "build/math.json",
"alias": "math"
},
"execute": {
"address": "0x138d4e2d306c0a9ef84dff00f6cc5e4d7b6f2329c9f88690ec6b8057e5e72f3",
"tx": "0x3448424346bc091ece116155d291b64c7a7f1028b76ca62cf65c71c1ddeae4e",
"address": "0x3f01333631cec91361849e66544ca8d788f2cc56502d58a9472a0670eac2d3",
"tx": "0x328d2bb04fdc942ce3ced33259cf3ec29986d76f30d58966b2959a5be6acd34",
"artifact": "build/execute.json",
"alias": "execute"
},
"Starksheet": {
"address": "0x4c60a51592fb92fdc7a70cd07efcd31ccced5d67bba5d153ffce673ed29e389",
"tx": "0x7ee5b01be2972ed6391cb6a3f002ac18aa72725c721c0de9522b36dccd73e2c",
"address": "0x177265be841470b54d72451f1c871b3b2a26c008b01d6f02356f019107287a1",
"tx": "0x12907ee228b5b6e3799dd2d826c836110dc54efad452a381ab78bd45ef57964",
"artifact": "build/Starksheet.json",
"alias": "starksheet"
}
Expand Down
12 changes: 7 additions & 5 deletions packages/starksheet-webapp/src/provider/StarknetProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,13 @@ export class StarknetProvider implements ChainProvider {
params: { chainId: this.config.chainId },
});
} else {
throw new Error(
`Wrong network detected: "${hex2str(
starknetWindow.provider.chainId
)}" instead of "${this.config.chainId}"`
);
if (starknetWindow.provider.chainId !== undefined) {
throw new Error(
`Wrong network detected: "${hex2str(
starknetWindow.provider.chainId
)}" instead of "${this.config.chainId}"`
);
}
}
}

Expand Down

0 comments on commit ed5e834

Please sign in to comment.