(itx interfaces.Transaction, count uint32)
| 203 | } |
| 204 | |
| 205 | func (dbms *DBMS) updateBilling(itx interfaces.Transaction, count uint32) { |
| 206 | var ( |
| 207 | tx *types.UpdateBilling |
| 208 | ok bool |
| 209 | ) |
| 210 | if tx, ok = itx.(*types.UpdateBilling); !ok { |
| 211 | log.WithFields(log.Fields{ |
| 212 | "type": itx.GetTransactionType(), |
| 213 | }).WithError(ErrInvalidTransactionType).Warn("invalid tx type in update billing") |
| 214 | return |
| 215 | } |
| 216 | // Get profile and database instance |
| 217 | var ( |
| 218 | id = tx.Receiver.DatabaseID() |
| 219 | profile *types.SQLChainProfile |
| 220 | database *Database |
| 221 | ) |
| 222 | le := log.WithFields(log.Fields{ |
| 223 | "id": id, |
| 224 | }) |
| 225 | if database, ok = dbms.getMeta(id); !ok { |
| 226 | le.Warn("cannot find database") |
| 227 | return |
| 228 | } |
| 229 | if profile, ok = dbms.busService.RequestSQLProfile(id); !ok { |
| 230 | le.Warn("cannot find profile") |
| 231 | return |
| 232 | } |
| 233 | database.chain.SetLastBillingHeight(int32(profile.LastUpdatedHeight)) |
| 234 | } |
| 235 | |
| 236 | func (dbms *DBMS) createDatabase(tx interfaces.Transaction, count uint32) { |
| 237 | cd, ok := tx.(*types.CreateDatabase) |
nothing calls this directly
no test coverage detected