simolus3 / web3dart

Ethereum library, written in Dart.
MIT License
441 stars 270 forks source link

Exceptions in metamask #204

Open cryptobys-rami opened 2 years ago

cryptobys-rami commented 2 years ago

So when I make a call on my contract which should revert with an exception, I can see the exception in my console:

final client = Web3Client(rpcUrl, Client(), socketConnector: () {
 return IOWebSocketChannel.connect(wsUrl).cast<String>();
  });

However, when I make the same call via metamask, the transaction fails, but the exception is swallowed somewhere:

final client = Web3Client.custom(eth.asRpcService());

Is there any way to be able to see this exception somewhere? it's important because otherwise we wouldn't know it has failed unless we look up the transaction hash later on etherscan or something.

cryptobys-rami commented 2 years ago

As a follow up, please see screenshots - Metamask recognises the exception but thats on the user side. In the code, I don't know where this exception goes because all I get is a transaction hash (unless I use an external api to find out what happened to the transaction).

Thanks very much in advance 49982B31-8C47-4584-A85F-382F69EF44D7_4_5005_c BFFF0AF7-4450-41D9-9F8A-B6FF63254E5B_4_5005_c