Skip to content

Commit

Permalink
Set asset pricing data column to null on updates from flow grpc (#562)
Browse files Browse the repository at this point in the history
* set data column to null

* do not need it defined on insert

* add change log
  • Loading branch information
nullpointer0x00 authored Oct 18, 2024
1 parent 68c19be commit a63258a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Docker images at tag `latest` for main branch merges [#551](https://github.com/provenance-io/explorer-service/pull/551)
* Refactor account processing implementation to be more efficient [#552](https://github.com/provenance-io/explorer-service/issues/552)
* Update keep alive times for flow api grpc calls [#558](https://github.com/provenance-io/explorer-service/pull/558)
* Updates to asset pricing table will set data column to null [#562](https://github.com/provenance-io/explorer-service/pull/562)

### Bug Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ object AssetPricingTable : IdTable<Int>(name = "asset_pricing") {
val pricing = decimal("pricing", 100, 50)
val pricingDenom = varchar("pricing_denom", 256)
val lastUpdated = datetime("last_updated")
val data = jsonb<AssetPricingTable, AssetPricing>("data", OBJECT_MAPPER)
val data = jsonb<AssetPricingTable, AssetPricing>("data", OBJECT_MAPPER).nullable()
}

class AssetPricingRecord(id: EntityID<Int>) : IntEntity(id) {
Expand All @@ -237,6 +237,7 @@ class AssetPricingRecord(id: EntityID<Int>) : IntEntity(id) {
findUnique(markerDenom, pricingDenom)?.apply {
this.pricing = pricingAmount
this.lastUpdated = timestamp
this.data = null
} ?: AssetPricingTable.insert {
it[this.markerId] = markerId
it[this.markerAddress] = markerAddress ?: ""
Expand Down

0 comments on commit a63258a

Please sign in to comment.