Closed eauge closed 5 years ago
To summarize offline conversations, we need an answer to the following question: can we guarantee that the web3c.js client has access to a transaction hash prior to actually sending it off to the gateway?
If the answer is yes, then this approach is swell. If the answer is no, then we might have a problem.
Imagine the following situation
If this is indeed a problem, then the implementation needs to support the case where the subscription happens after the transaction is sent.
If we're using a websocket connection, one way around this is to subscribe to all transactions from a given address. Send the transaction through the exact same websocket connection, and then receive the response. This works because we're connected to the same gateway instance. If we can't guarantee that we're connected to the same gateway instance, the return value is not retrieved by the gateway that didn't initiate the transaction.
A more complicated solution would be to somehow store and allow the gateway to fetch the return value. This seems like the most immediate solution if we use storage.
@eauge @willscott @peterjgilbert thoughts here?
@armaniferrante good summary.
I would suggest to try to find a way to access the transactionHash of a transaction before sending it. If that's not possible, I would do the trick of subscribing to transactions for a fromAddress
.
I would avoid including storage to this unless strictly necessary. Then there would be all sorts of other problems.
Implement a completedTransaction that can handle transactions from confidential contracts