Zilliqa / zilliqa-developer

GNU General Public License v3.0
2 stars 5 forks source link

Fix `DifferentChainID` error #722

Closed JamesHinshelwood closed 2 months ago

JamesHinshelwood commented 2 months ago

PR #699 attempted to remove the startup-time dependency on the API by moving the point at which we get the chain ID to transaction creation time.

However, this wasn't valid because the signer needs to be configured with the correct chain ID. Instead, we wrap our provider in a tokio::sync::OnceCell and lazily initialise it.

This means the signer is initialised with the result of the call from eth_chainId, but we don't need to make this call until someone uses the faucet.