You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current situation you can not ensure that the balance does still contain enough assets when app.balances.decrease() run actually.
Also we got some troubles when app.balances.decrease() fails and app.balances.decrease() did not fail or visa versa.
The text was updated successfully, but these errors were encountered:
In fact the main problem seems to be that one shouldn't not be able to invoke a increase or decrease of the balance at all. A contract should always do a transfer (from the balance of the sender to the balance of the receiver). transfer() should check if the balance of the sender contains enough assets. So i suggest to replace https://github.com/AschPlatform/asch-core/blob/master/src/smartdb/balance-manager.js with the code shown beneath:
Version
1.4
Environment
linux
Steps to reproduce
from https://github.com/AschPlatform/cctime/blob/master/contract/cctime.js#L90 the code (in summary) looks like that shown below:
What is expected?
Something like that shown beneath:
also see: https://sqlite.org/lang_transaction.html
What is actually happening?
In the current situation you can not ensure that the balance does still contain enough assets when
app.balances.decrease()
run actually.Also we got some troubles when
app.balances.decrease()
fails andapp.balances.decrease()
did not fail or visa versa.The text was updated successfully, but these errors were encountered: