Skip to content

Commit

Permalink
Merge pull request #21 from FigureTechnologies/pierce/support-provena…
Browse files Browse the repository at this point in the history
…nce-1.19

upgrade kotlin tools to support provenance 1.19.-rc1+
  • Loading branch information
celloman authored Oct 21, 2024
2 parents 4a7ecf3 + ed2d9a6 commit 6b3ab78
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ subprojects {
val artifactName = "member-approval-$name"
val artifactVersion = projectVersion.toString()


tasks.withType<PublishToMavenLocal> {
signing.isRequired = false
}

configure<PublishingExtension> {
publications {
create<MavenPublication>("maven") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ internal fun BroadcastTxResponse.singleWasmEvent(): Event = txResponse
?: error("Expected a single wasm event to be emitted when executing the smart contract")

internal fun Event.getAttributeValue(attribute: String): String = attributesList
.singleOrNull { it.key.toStringUtf8() == attribute }
.singleOrNull { it.key == attribute }
?.value
?.toStringUtf8()
?: error("Expected attribute [$attribute] to be emitted by the smart contract")

internal fun BroadcastTxResponse.checkSuccess(): BroadcastTxResponse = this.also {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ class LocalGroupMemberContractClient(
.eventsList
.singleOrNull { it.type == "instantiate" }
?.attributesList
?.singleOrNull { it.key.toStringUtf8() == "_contract_address" }
?.singleOrNull { it.key == "_contract_address" }
?.value
?.toStringUtf8()
.orThrow { IllegalStateException("Failed to find contract address after instantiating contract with code id [$codeId]") }
.let { contractAddress ->
InstantiateGroupMemberContractResponse(storedCodeId = codeId, contractAddress = contractAddress)
Expand Down Expand Up @@ -111,8 +110,8 @@ class LocalGroupMemberContractClient(
}.gzip().let { gzippedWasmBytes ->
pbClient.estimateAndBroadcastTx(
txBody = MsgStoreCode.newBuilder().also { storeCode ->
storeCode.instantiatePermissionBuilder.address = admin.address()
storeCode.instantiatePermissionBuilder.permission = Types.AccessType.ACCESS_TYPE_ONLY_ADDRESS
storeCode.instantiatePermissionBuilder.addAddresses(admin.address())
storeCode.instantiatePermissionBuilder.permission = Types.AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES
storeCode.sender = admin.address()
storeCode.wasmByteCode = gzippedWasmBytes.toByteString()
}.build().toAny().toTxBody(),
Expand All @@ -123,9 +122,8 @@ class LocalGroupMemberContractClient(
.eventsList
.singleOrNull { it.type == "store_code" }
?.attributesList
?.singleOrNull { it.key.toStringUtf8() == "code_id" }
?.singleOrNull { it.key == "code_id" }
?.value
?.toStringUtf8()
?.toLongOrNull()
.orThrow { IllegalStateException("Failed to derive code id from stored contract") }
}
Expand Down
4 changes: 2 additions & 2 deletions kotlin-tools/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jackson = "2.14.1"
jackson-protobuf = "0.9.13"
kotlin = "1.9.10"
protobuf = "3.21.12"
provenance-client = "2.4.0"
provenance-client = "2.5.0"
provenance-hdwallet = "0.1.15"
provenance-proto = "1.13.0"
provenance-proto = "1.19.0"
provenance-scope = "0.6.2"

[libraries]
Expand Down

0 comments on commit 6b3ab78

Please sign in to comment.