Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lealobanov committed Nov 11, 2024
1 parent 9625eef commit cf7a14c
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ class FlowAccessApiImpl(
}
}

private fun <T> executeWithResponse(action: () -> T, errorMessage: String): FlowAccessApi.AccessApiCallResponse<T> {
return try {
private fun <T> executeWithResponse(action: () -> T, errorMessage: String): FlowAccessApi.AccessApiCallResponse<T> =
try {
FlowAccessApi.AccessApiCallResponse.Success(action())
} catch (e: Exception) {
FlowAccessApi.AccessApiCallResponse.Error(errorMessage, e)
}
}

override fun ping(): FlowAccessApi.AccessApiCallResponse<Unit> =
executeWithResponse(
Expand Down Expand Up @@ -145,7 +144,6 @@ class FlowAccessApiImpl(
errorMessage = "Failed to get block header by height"
)


override fun getLatestBlock(sealed: Boolean, fullBlockResponse: Boolean): FlowAccessApi.AccessApiCallResponse<FlowBlock> =
executeWithResponse(
action = {
Expand Down Expand Up @@ -190,7 +188,6 @@ class FlowAccessApiImpl(
errorMessage = "Failed to get account balance at block height"
)


override fun getBlockById(id: FlowId, fullBlockResponse: Boolean): FlowAccessApi.AccessApiCallResponse<FlowBlock> =
executeWithResponse(
action = {
Expand Down Expand Up @@ -277,7 +274,6 @@ class FlowAccessApiImpl(
errorMessage = "Failed to get transaction by ID"
)


override fun getTransactionResultById(id: FlowId): FlowAccessApi.AccessApiCallResponse<FlowTransactionResult> =
executeWithResponse(
action = {
Expand Down Expand Up @@ -335,7 +331,6 @@ class FlowAccessApiImpl(
errorMessage = "Failed to get system transaction result by block ID"
)


@Deprecated("Behaves identically to getAccountAtLatestBlock", replaceWith = ReplaceWith("getAccountAtLatestBlock"))
override fun getAccountByAddress(address: FlowAddress): FlowAccessApi.AccessApiCallResponse<FlowAccount> =
executeWithResponse(
Expand Down

0 comments on commit cf7a14c

Please sign in to comment.