Skip to content

Commit 3359915

Browse files
Merge pull request #94 from FigureTechnologies/jschwartz/upgrade-event-stream-to-0.8.0
Bugfix: Upgrade event stream libs to 0.8.0 to fix fee explosions
2 parents 396c4d3 + 90d1a94 commit 3359915

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ asset-specs = "1.0.0"
44
blockapi = "0.1.9"
55
bouncycastle = "1.70"
66
feign = "12.1"
7-
figure-eventstream = "0.7.1"
7+
figure-eventstream = "0.8.0"
88
grpc = "1.51.1"
99
jackson = "2.14.1"
1010
jackson-protobuf = "0.9.13"

verifier/src/main/kotlin/tech/figure/classification/asset/verifier/provenance/AssetClassificationEvent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class AssetClassificationEvent(
6363
value = attribute.value,
6464
)
6565
},
66-
fee = sourceTx.tx.authInfo.fee.amountList.firstOrNull()?.amount?.toLongOrNull(),
66+
fee = sourceTx.tx.authInfo.fee.amountList.firstOrNull()?.amount?.toBigIntegerOrNull(),
6767
denom = sourceTx.tx.authInfo.fee.amountList.firstOrNull()?.denom,
6868
note = null,
6969
),

verifier/src/main/kotlin/tech/figure/classification/asset/verifier/util/eventstream/providers/DefaultEventStreamProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import tech.figure.classification.asset.verifier.provenance.AssetClassificationE
1111
import tech.figure.classification.asset.verifier.provenance.WASM_EVENT_TYPE
1212
import tech.figure.classification.asset.verifier.util.eventstream.verifierBlockDataFlow
1313
import tech.figure.eventstream.decoder.moshiDecoderAdapter
14-
import tech.figure.eventstream.net.defaultOkHttpClient
14+
import tech.figure.eventstream.net.defaultOkHttpClientBuilderFn
1515
import tech.figure.eventstream.net.okHttpNetAdapter
1616
import tech.figure.eventstream.stream.clients.BlockData
1717
import tech.figure.eventstream.stream.models.dateTime
@@ -21,7 +21,7 @@ import java.net.URI
2121

2222
class DefaultEventStreamProvider(
2323
eventStreamNode: URI = URI("ws://localhost:26657"),
24-
httpClient: OkHttpClient = defaultOkHttpClient()
24+
httpClient: OkHttpClient = defaultOkHttpClientBuilderFn().run { OkHttpClient.Builder().this() }.build(),
2525
) : EventStreamProvider {
2626

2727
private val netAdapter = okHttpNetAdapter(

verifier/src/test/kotlin/tech/figure/classification/asset/verifier/testhelpers/MockTxEvent.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import tech.figure.classification.asset.verifier.provenance.AssetClassificationE
55
import tech.figure.eventstream.stream.models.Event
66
import tech.figure.eventstream.stream.models.TxEvent
77
import tech.figure.eventstream.stream.models.toHexString
8+
import java.math.BigInteger
89
import java.time.OffsetDateTime
910
import java.util.UUID
1011

@@ -15,7 +16,7 @@ object MockTxEvent {
1516
private companion object {
1617
private const val DEFAULT_BLOCK_HEIGHT: Long = 1L
1718
private const val DEFAULT_EVENT_TYPE: String = "wasm"
18-
private const val DEFAULT_FEE_AMOUNT: Long = 0L
19+
private val DEFAULT_FEE_AMOUNT: BigInteger = BigInteger.ZERO
1920
private const val DEFAULT_DENOM: String = "nhash"
2021
private const val DEFAULT_NOTE: String = "MOCKED TX"
2122
}
@@ -25,7 +26,7 @@ object MockTxEvent {
2526
private var txHash: String? = null
2627
private var eventType: String? = null
2728
private var attributes: MutableList<Event> = mutableListOf()
28-
private var fee: Long? = null
29+
private var fee: BigInteger? = null
2930
private var denom: String? = null
3031
private var note: String? = null
3132

@@ -36,7 +37,7 @@ object MockTxEvent {
3637
fun setACEventType(eventType: ACContractEvent) = apply { this.eventType = eventType.contractName }
3738
fun addAttribute(attribute: Event) = apply { this.attributes.add(attribute) }
3839
fun addACAttribute(attribute: MockACAttribute) = apply { this.attributes.add(attribute.toAttribute()) }
39-
fun setFee(fee: Long) = apply { this.fee = fee }
40+
fun setFee(fee: BigInteger) = apply { this.fee = fee }
4041
fun setDenom(denom: String) = apply { this.denom = denom }
4142
fun setNote(note: String) = apply { this.note = note }
4243

0 commit comments

Comments
 (0)