pigjar-67 Add invariant checks on transactions.