Use a dummy address for the read-only signer
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

Necessary for ethers not to fail with public RSK nodes
This commit is contained in:
Râu Cao 2022-11-01 15:03:58 +01:00
parent a1a68092f6
commit 6e0ec8741e
Signed by: raucao
GPG Key ID: 15E65F399D084BA9
1 changed files with 4 additions and 1 deletions

View File

@ -69,7 +69,10 @@ class Kredits {
if (wallet) {
signer = wallet.connect(ethProvider);
} else if (ethProvider.getSigner) {
signer = ethProvider.getSigner();
// Only useful for reading data, not writing. The (unused) address is
// necessary because without an address, ethers.js will try to look up
// the provider's account 0, which doesn't work on our public RSK nodes.
signer = ethProvider.getSigner('0xfa77675540E550b911a6AABF3805ac17C6641ec1');
}
return new Kredits(ethProvider, signer, kreditsOptions);
}