From bb735098b7a140f7af99ed5f1922e125ffab15c0 Mon Sep 17 00:00:00 2001 From: Luca Spinazzola Date: Fri, 30 Sep 2022 14:10:21 -0400 Subject: [PATCH] populateCodeHash bugfix for blank codeHash --- .../kotlin/io/eqoty/secretk/client/SigningCosmWasmClient.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/secretk/src/commonMain/kotlin/io/eqoty/secretk/client/SigningCosmWasmClient.kt b/secretk/src/commonMain/kotlin/io/eqoty/secretk/client/SigningCosmWasmClient.kt index 576aa76..40b6c28 100644 --- a/secretk/src/commonMain/kotlin/io/eqoty/secretk/client/SigningCosmWasmClient.kt +++ b/secretk/src/commonMain/kotlin/io/eqoty/secretk/client/SigningCosmWasmClient.kt @@ -288,11 +288,11 @@ private constructor( private suspend fun Msg<*>.populateCodeHash() { if (this is MsgExecuteContract) { - if (codeHash == null) { + if (codeHash.isNullOrBlank()) { codeHash = restClient.getCodeHashByContractAddr(contractAddress) } } else if (this is MsgInstantiateContract) { - if (codeHash == null) { + if (codeHash.isNullOrBlank()) { codeHash = restClient.getCodeInfoByCodeId(codeId.toString()).codeHash } }