Comments (1)
Current approach
The @tcoratger idea is a correct approach, however we believe it could be simplified a bit more. Unless there is a specific reason/use case for introducing a new type like JsonRpcRequests
, we could just define a vector of JsonRpcRequest
. The rest would be the same as suggested in the original Issue description.
Implementation details
For now the function send_requests
can be implemented in the JsonRpcTransport
struct and called with vector of requests as an argument. Itβs easy to pass requests of the same JsonRpcMethod
.
Improvement proposal
An improvement to this implementation is up for discussion and a separate issue. In essense, if we want to make a batch request of different RPC methods we need to implement enum of JsonRpcRequest
params to allow vector to store different data types.
The general idea would be the following:
We introduce an enum
type that allows all possible payloads to be passed through the generic type.
_The only limitation here would be that whenever there is a new request type, the enum needs to be expanded in the library, which is not very robust - hence just this is a topic for separate discussion.
Summary
If the presented approach in the first 2 paragraphs is compatible with the lib, we already have the code working and we would like to share it in a new PR to be verified by the @xJonathanLEI
from starknet-rs.
Related Issues (20)
- Support RPC 0.6.0 HOT 2
- `FieldElement` doesn't seem to support deserializing from non self-describing format HOT 1
- Fails to calculate Cairo 0 class hash when `program.attributes` is missing `accessible_scopes` HOT 4
- `validate_invocation` and `fee_transfer_invocation` fields don't have to be `Option` in `TransactionTrace` types HOT 4
- Make input for Accout::sign_execution publicly constructable HOT 3
- Remove `infinity` flag from `ProjectivePoint` HOT 3
- Migrate to starnet-types-rs Felt?
- Explanation: Comments have been added to explain the general purpose of the script and specific functions. Variables have more descriptive names to improve readability. Logic for cleaning and creating the target directory is clarified. Additional comments in the loop sections to explain the purpose of each step. Comments added for clarification in some loop steps.
- No reference to `result.transactions[0].sender_address` property in `starknet_getBlockWithTxs` method. HOT 1
- Support for STRK Fee Payment in RPC HOT 1
- `compute_hash_on_elements` could accept any iterator on `FieldElement` HOT 4
- Divide by zero panics in `bigint_mul_mod_floor` and `mul_mod_floor` if modulus set to 0 HOT 3
- `deploy_argent_account` has error
- Add more clippy lint rules HOT 2
- Add warn on `clippy::needless_pass_by_value` HOT 1
- Unify `pub enum TransactionStatus` variants HOT 1
- replace Poseidon implementation by `types-rs` HOT 2
- replace Pedersen implementation by `type-rs` HOT 2
- UDC: Contract deployment selector mismatch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starknet-rs.