Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpointer0x00 committed Nov 14, 2023
2 parents 3f25d9c + a338f97 commit 285e094
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 155 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,16 @@ Ref: https://keepachangelog.com/en/1.0.0/

## Unreleased

## [v5.7.0](https://github.com/provenance-io/explorer-service/releases/tag/v5.7.0) - 2023-11-14
### Release Name: Peter Fidler

### Improvements
* Add aggregation of orderbooks for hash historical pricing [#496](https://github.com/provenance-io/explorer-service/issues/496)
* Updated Prov Protos from 1.17.0 [#505](https://github.com/provenance-io/explorer-service/issues/505)

### Bug Fixes
* Fix parsing of ibc json packet [#501](https://github.com/provenance-io/explorer-service/issues/501)
* Fix groups proposal error [#499](https://github.com/provenance-io/explorer-service/issues/499)

## [v5.6.0](https://github.com/provenance-io/explorer-service/releases/tag/v5.6.0) - 2023-07-05
### Release Name: Niels Peter
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object Versions {
const val SpringBoot = PluginVersions.SpringBoot
const val Swagger = "3.0.0"
const val Grpc = "1.50.2"
const val ProvProto = "1.17.0-rc1"
const val ProvProto = "1.17.0"
const val Postgres = "42.2.23"
const val Protobuf = "3.21.9"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import io.provenance.explorer.model.base.Bech32
import io.provenance.explorer.model.base.toBech32Data
import io.provenance.explorer.model.base.toMAddress
import net.pearx.kasechange.splitToWords
import org.apache.commons.text.StringEscapeUtils
import org.joda.time.DateTime
import org.joda.time.DateTimeZone
import tendermint.types.BlockOuterClass
Expand Down Expand Up @@ -158,7 +157,7 @@ fun BlockOuterClass.Block.height() = this.header.height.toInt()
fun Long.get24HrBlockHeight(avgBlockTime: BigDecimal) =
BigDecimal(24 * 60 * 60).divide(avgBlockTime, 0, RoundingMode.HALF_UP).let { this - it.toInt() }

fun String.toObjectNode() = OBJECT_MAPPER.readValue(StringEscapeUtils.unescapeJson(this), ObjectNode::class.java)
fun String.toObjectNode() = OBJECT_MAPPER.readValue(this, ObjectNode::class.java)
fun Any?.stringify() = if (this == null) null else OBJECT_MAPPER.writeValueAsString(this)

fun List<BigDecimal>.average() = this.fold(BigDecimal.ZERO, BigDecimal::add)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,12 +911,12 @@ fun getGroupPolicyEventByEvent(event: String) = GroupPolicyEvents.values().first

enum class GroupGovMsgType { PROPOSAL, VOTE, EXEC, WITHDRAW }

fun Any.getAssociatedGroupProposals() =
fun Any.getAssociatedGroupProposals(index: Int): Triple<Int, GroupGovMsgType, Any>? =
when {
typeUrl.endsWith("group.v1.MsgSubmitProposal") -> GroupGovMsgType.PROPOSAL to this
typeUrl.endsWith("group.v1.MsgVote") -> GroupGovMsgType.VOTE to this
typeUrl.endsWith("group.v1.MsgExec") -> GroupGovMsgType.EXEC to this
typeUrl.endsWith("group.v1.MsgWithdrawProposal") -> GroupGovMsgType.WITHDRAW to this
typeUrl.endsWith("group.v1.MsgSubmitProposal") -> Triple(index, GroupGovMsgType.PROPOSAL, this)
typeUrl.endsWith("group.v1.MsgVote") -> Triple(index, GroupGovMsgType.VOTE, this)
typeUrl.endsWith("group.v1.MsgExec") -> Triple(index, GroupGovMsgType.EXEC, this)
typeUrl.endsWith("group.v1.MsgWithdrawProposal") -> Triple(index, GroupGovMsgType.WITHDRAW, this)
else -> null.also { logger().debug("This typeUrl is not a group-governance-based msg: $typeUrl") }
}

Expand Down
Loading

0 comments on commit 285e094

Please sign in to comment.