Closed kristjank closed 3 years ago
Good question, this is still WIP so we will also get to remodelling this part, which could also be part of the new AIP structure, related to overall integration into the wallet manager and validation mechanics.
Why canApply
is synchronous ? What if I need to do asynchronous operations to verify transaction application ?
In my use-case, I want to call database in the canApply
function and db uses pg-promise
to query, which is fully async.
@Nigui Thanks for the feedback. Initially the idea was to only allow synchronous operations because it reduces the risk of performing any expensive tasks. Triggering the database will degrade the overall throughput of such transactions. Anyway, I agree that there are use cases which require asynchronous operations, but cannot be realized due to this limitation. We will look into it!
Stale issue message
Are
apply
andrevert
methods of transaction handler deliberately omitted ? If so, how can we specify modifications of the current blockchain state ?