Module tea_sdk::actor_txns::context

Modules

Structs

  • TokenContext implement the context trait it store all changes a txn made before actually commit to state When there is a read inside a txn logic, it will check its context first, in case there is a prior change made by prior logic when write, all write in context without changing the actual state, until final commit if commit fail, nothing will change in the state. if commit succeed, everything will be write into the state.

Enums

  • ReadConflictMode is used to determine if other context have a Credit or Debit operation, will that cause this READ operation invalid. For example, if I read an account balance, and if it is greater than a certain amount then running my logic. In this case, if there is another concurrent credit operation, my logic is still valid. Because credit will just increase the account balance. my original logic “greater than” is still valid. But if there was a Debit operation, my logic might be “invalid” because the debit reduce the balance, that my “greater than” logic might be fail. In this case, the read is conflict. It may cause a rerun when merge Those four enum values means in what situation, my read will be valid / invalid These values are important when running a context merge or rebase

Traits