-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RequestResult
type
#478
Conversation
lib/src/main/kotlin/com/swmansion/starknet/data/types/StarknetResult.kt
Outdated
Show resolved
Hide resolved
lib/src/main/kotlin/com/swmansion/starknet/data/types/StarknetResult.kt
Outdated
Show resolved
Hide resolved
lib/src/main/kotlin/com/swmansion/starknet/data/types/StarknetResult.kt
Outdated
Show resolved
Hide resolved
…sult` to `RequestResult`
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #478 +/- ##
==========================================
- Coverage 71.12% 69.63% -1.49%
==========================================
Files 75 89 +14
Lines 3338 3385 +47
Branches 367 369 +2
==========================================
- Hits 2374 2357 -17
- Misses 798 867 +69
+ Partials 166 161 -5 ☔ View full report in Codecov by Sentry. |
… into feat/477-change-result-type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but let's wait for final approval from @DelevoXDG
fun <T> success(value: T): RequestResult<T> = RequestResult(Result.success(value)) | ||
|
||
fun <T> failure(throwable: Throwable): RequestResult<T> = | ||
RequestResult(Result.failure(throwable)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
fun <T> success(value: T): RequestResult<T> = RequestResult(Result.success(value)) | |
fun <T> failure(throwable: Throwable): RequestResult<T> = | |
RequestResult(Result.failure(throwable)) | |
fun <T> success(value: T) = RequestResult(Result.success(value)) | |
fun <T> failure(throwable: Throwable) = RequestResult(Result.failure(throwable)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually in failure
we have to keep RequestResult<T>
, as there is not enough information to infer the type.
…esult.kt Co-authored-by: Maksim Zdobnikau <[email protected]>
…ware-mansion/starknet-jvm into feat/477-change-result-type
Describe your changes
RequestResult
which is a wrapper for kotlin'sResult
Linked issues
Closes #477
Breaking changes
HttpBatchRequest
send(): List<Result<T>>
->send(): List<RequestResult<T>>
sendAsync(): CompletableFuture<List<Result<T>>>
->sendAsync(): CompletableFuture<List<RequestResult<T>>>