CommitWithStorageDiff commits the transaction and applies the storage diff, only if the transaction is not inherited.
(ctx context.Context, tx *Tx, l logging.Logger, uc UserClient)
| 101 | |
| 102 | // CommitWithStorageDiff commits the transaction and applies the storage diff, only if the transaction is not inherited. |
| 103 | func CommitWithStorageDiff(ctx context.Context, tx *Tx, l logging.Logger, uc UserClient) error { |
| 104 | commited, err := commit(tx) |
| 105 | if err != nil { |
| 106 | return err |
| 107 | } |
| 108 | |
| 109 | if !commited { |
| 110 | return nil |
| 111 | } |
| 112 | |
| 113 | if err := uc.ApplyStorageDiff(ctx, tx.storageDiff); err != nil { |
| 114 | l.Error("Failed to apply storage diff", "error", err) |
| 115 | } |
| 116 | |
| 117 | return nil |
| 118 | } |
no test coverage detected