Skip to content

Commit

Permalink
feat(rpc/v06): re-add write API
Browse files Browse the repository at this point in the history
The BROADCASTED_TRANSACTION schema is unchanged between the 0.6.0
and 0.7.1 OpenRPC specification and the write API methods are the
same, too.

We can just re-enable `starknet_add*Transaction` methods with our
current implementation.

Closes #2553
  • Loading branch information
kkovaacs committed Jan 31, 2025
1 parent d487c6d commit a053a0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
12 changes: 2 additions & 10 deletions crates/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -988,16 +988,8 @@ mod tests {
],
Api::HttpOnly)]
// #[case::v0_6_trace_websocket("/ws/rpc/v0_6", "v06/starknet_trace_api_openrpc.json", &[], Api::WebsocketOnly)]
#[case::v0_6_write(
"/rpc/v0_6",
"v06/starknet_write_api.json",
&[
"starknet_addInvokeTransaction",
"starknet_addDeclareTransaction",
"starknet_addDeployAccountTransaction",
],
Api::HttpOnly)]
// #[case::v0_6_write_websocket("/ws/rpc/v0_6", "v06/starknet_write_api.json", &[], Api::WebsocketOnly)]
#[case::v0_6_write("/rpc/v0_6", "v06/starknet_write_api.json", &[], Api::HttpOnly)]
#[case::v0_6_write_websocket("/ws/rpc/v0_6", "v06/starknet_write_api.json", &[], Api::WebsocketOnly)]
// get_transaction_status is now part of the official spec, so we are phasing it out.
#[case::v0_6_pathfinder("/rpc/v0_6", "pathfinder_rpc_api.json", &["pathfinder_version", "pathfinder_getTransactionStatus"], Api::HttpOnly)]
#[case::v0_6_pathfinder_websocket("/ws/rpc/v0_6", "pathfinder_rpc_api.json", &["pathfinder_version", "pathfinder_getTransactionStatus"], Api::WebsocketOnly)]
Expand Down
3 changes: 3 additions & 0 deletions crates/rpc/src/v06.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ use crate::jsonrpc::{RpcRouter, RpcRouterBuilder};
#[rustfmt::skip]
pub fn register_routes() -> RpcRouterBuilder {
RpcRouter::builder(crate::RpcVersion::V06)
.register("starknet_addDeclareTransaction", crate::method::add_declare_transaction)
.register("starknet_addDeployAccountTransaction", crate::method::add_deploy_account_transaction)
.register("starknet_addInvokeTransaction", crate::method::add_invoke_transaction)
.register("starknet_blockNumber", crate::method::block_number)
.register("starknet_blockHashAndNumber", crate::method::block_hash_and_number)
.register("starknet_chainId", crate::method::chain_id)
Expand Down

0 comments on commit a053a0f

Please sign in to comment.