AppendStorageDiff appends the given storage diff to the transaction.
(diff StorageDiff)
| 28 | |
| 29 | // AppendStorageDiff appends the given storage diff to the transaction. |
| 30 | func (t *Tx) AppendStorageDiff(diff StorageDiff) { |
| 31 | root := t |
| 32 | for root.inherited { |
| 33 | root = root.parent |
| 34 | } |
| 35 | |
| 36 | if root.storageDiff == nil { |
| 37 | root.storageDiff = diff |
| 38 | } else { |
| 39 | root.storageDiff.Merge(diff) |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | // WithTx wraps the given inventory client with a transaction. |
| 44 | func WithTx[T TxOperator](ctx context.Context, c T) (T, *Tx, context.Context, error) { |
no test coverage detected