Skip to content

Commit

Permalink
Merge branch 'release/1.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
dgeorgiev committed Mar 28, 2024
2 parents f53a2ea + 8c51949 commit 9b8971f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 <T> getNullableValue(key: String, valueType: Class<T>): T? =
getKeyValue(key)?.run {
Expand Down

0 comments on commit 9b8971f

Please sign in to comment.