i'm trying to implement escrow contract and all works pretty well, but recently i found one weird case:
SImplified example:
Account A - amount 10
Account B - amount 5
Account C - amount 0, limit 5
I created 5 pre auth transactions with time bounds, which sends assets(amount 1) from B to C.
So i can post these preAuth transactions, when time bounds are valid and assets goes to C.
let's assume i've posted 3 preAuth transactions:
A - amount 10,
B - amount 2,
C - amount 3, limit 5.
After that i accidentally sent amount 2 from A to C and got:
A - amount 8,
B - amount 2,
C - amount 5, limit 5.
Account C reached its limit and now if i try to post next pre auth transaction i' ll get "result_codes": {
"transaction": "tx_failed",
"operations": [
"op_line_full"
]
All looks reasonable, limit cannot be exceeded, but after that try, account B sequence was increased by one, since that time my unused pre auth transactions became invalid, because of bad sequence.
It looks weird for me, that failed transaction increases account sequence and can break pre auth transactions scheme, please correct me, if I'm missing something in sequence concept.