Open iherger opened 4 months ago
Ah - I think we currently assume that there are never multiple networks with the same chainId, so you're seeing undefined/untested behavior here. We should add a validation against this.
That aside, could you share more about why you want this? Do you have both a "test" contract and the prod contract deployed to the same (prod) chain?
We indeed have a test deployment of all contracts on Polygon mainnet (mostly due to third-party integrations being available there).
Am I correct in understanding that you want to prevent the definition of multiple networks with the same chainId? For us, it would be useful to be able to have multiple networks with the same chainId, though.
Not sure if this is supposed to work, but it would be great if it did.
I have configured multiple networks as follows (note that there are two networks with the same chainId, which correspond to two different contract deployments):
I have also defined all those networks for a contract.
Now, the
setup
event for that contract is invoked 4 times (correct), but thecontext.network
property is somewhat mixed up:Is this supposed to work? Can you have multiple networks with the same chainId?