diff --git a/gradle.properties b/gradle.properties index f12f95b..f7109f7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -35,7 +35,7 @@ mockkVersion=1.12.3 springMockkVersion=3.1.1 # WE SDK -weNodeClientVersion=1.1.0 +weNodeClientVersion=1.3.1 # GitHub properties gitHubProject = "waves-enterprise/we-contract-sdk" diff --git a/we-contract-sdk-core/src/main/kotlin/com/wavesenterprise/sdk/contract/core/state/ContractStateReaderIml.kt b/we-contract-sdk-core/src/main/kotlin/com/wavesenterprise/sdk/contract/core/state/ContractStateReaderIml.kt index 0e339d3..710e33e 100644 --- a/we-contract-sdk-core/src/main/kotlin/com/wavesenterprise/sdk/contract/core/state/ContractStateReaderIml.kt +++ b/we-contract-sdk-core/src/main/kotlin/com/wavesenterprise/sdk/contract/core/state/ContractStateReaderIml.kt @@ -13,6 +13,7 @@ import com.wavesenterprise.sdk.contract.core.state.mapping.ReadMappingForType import com.wavesenterprise.sdk.contract.core.state.mapping.ReadMappingForTypeReference import com.wavesenterprise.sdk.node.domain.DataEntry import com.wavesenterprise.sdk.node.domain.contract.ContractId +import com.wavesenterprise.sdk.node.exception.specific.DataKeyNotExistException import java.util.Optional class ContractStateReaderIml( @@ -90,7 +91,11 @@ class ContractStateReaderIml( } private fun getKeyValue(key: String): DataEntry? = - backingMap[key] ?: nodeContractStateValuesProvider.getForKeyAsNullable(contractId, key)?.also { backingMap[key] = it } + try { + backingMap[key] ?: nodeContractStateValuesProvider.getForKeyAsNullable(contractId, key)?.also { backingMap[key] = it } + } catch (ex: DataKeyNotExistException) { + null + } private fun getNullableValue(key: String, valueType: Class): T? = getKeyValue(key)?.run {