-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support batching multiple RPC requests of different types #461
Support batching multiple RPC requests of different types #461
Conversation
…pcProvider` calls
…ider` signatures
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.
partial review
lib/src/main/kotlin/com/swmansion/starknet/data/serializers/IntWrapperSerializer.kt
Outdated
Show resolved
Hide resolved
lib/src/main/kotlin/com/swmansion/starknet/data/serializers/StringWrapperSerializer.kt
Outdated
Show resolved
Hide resolved
lib/src/main/kotlin/com/swmansion/starknet/data/types/FeltArray.kt
Outdated
Show resolved
Hide resolved
...main/kotlin/com/swmansion/starknet/service/http/requests/HttpBatchRequestOfDifferentTypes.kt
Outdated
Show resolved
Hide resolved
….com/software-mansion/starknet-jvm into feat/443-2-batch-multiple-rpc-requests
…Test.kt Co-authored-by: Maksim Zdobnikau <43750648+DelevoXDG@users.noreply.github.com>
…ub.com/software-mansion/starknet-jvm into feat/443-2-batch-multiple-rpc-requests
lib/src/main/kotlin/com/swmansion/starknet/provider/rpc/JsonRpcProvider.kt
Outdated
Show resolved
Hide resolved
lib/src/test/kotlin/starknet/provider/response/JsonRpcResponseTest.kt
Outdated
Show resolved
Hide resolved
import com.swmansion.starknet.data.types.TransactionExecutionStatus | ||
import com.swmansion.starknet.data.types.TransactionStatus |
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.
Why this change?
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.
Transaction.kt
and TransactionReceipt.kt
files to were moved from types/transactions
to types
because inheritor of sealed class/interface must be in in the same package where this sealed class/interface is defined. Actually, I moved other files from types/transactions
directory to types
, because imo it doesn't make sense if transacion-related files are split between directory and subdirectory. Wdyt?
...rc/main/kotlin/com/swmansion/starknet/data/serializers/SimulatedTransactionListSerializer.kt
Outdated
Show resolved
Hide resolved
lib/src/main/kotlin/com/swmansion/starknet/data/types/StarknetString.kt
Outdated
Show resolved
Hide resolved
lib/src/main/kotlin/com/swmansion/starknet/data/types/HttpBatchRequestType.kt
Outdated
Show resolved
Hide resolved
lib/src/main/kotlin/com/swmansion/starknet/provider/rpc/BuildJsonHttpDeserializer.kt
Outdated
Show resolved
Hide resolved
lib/src/main/kotlin/com/swmansion/starknet/provider/rpc/BuildJsonHttpDeserializer.kt
Outdated
Show resolved
Hide resolved
…ename `HttpRequestType` to `Response`
336aa42
into
feat/443-batch-multiple-rpc-requests
…)" This reverts commit 336aa42.
Describe your changes
Add support for batching requests of different type
JsonRpcProvider.batchRequestsAny()
HttpBatchRequest
classStarknetResponse
as common return type forJsonRpcProvider
callsIntResponse
,StringResponse
JsonRpcProvider
methods and their corresponding serializersFeltArraySerializer
Allow proceeding with failure of particular requests while using
batchRequests
andbatchRequestsAny
send()
andsendAsync()
methods inResult
Update tests:
batch requests any
inProviderTest
rpc provider parses batch response with error
inJsonRpcResponseTest
JsonRpcResponseTest
due to changes ofJsonRpcProvider
methodsLinked issues
Closes
Breaking changes
JsonRpcProvider
methods:getSpecVersion(): HttpRequest<String>
->getSpecVersion(): HttpRequest<StringResponse>
callContract(...): HttpRequest<List<Felt>>
->callContract(...): HttpRequest<FeltArray>
getBlockNumber(): HttpRequest<Int>
->getBlockNumber(): HttpRequest<StarknetInt>
getBlockTransactionCount(...): HttpRequest<Int>
->getBlockTransactionCount(...): HttpRequest<IntResponse>
getEstimateFee(...): HttpRequest<List<EstimateFeeResponse>>
->getEstimateFee(...): HttpRequest<EstimateFeeResponseList>
simulateTransactions(...): HttpRequest<List<SimulatedTransaction>>
->simulateTransactions(...): HttpRequest<SimulatedTransactionList>