-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor
katana
RPC components into smaller crates (#1461)
- Loading branch information
Showing
30 changed files
with
487 additions
and
296 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[package] | ||
description = "Katana RPC APIs" | ||
edition.workspace = true | ||
name = "katana-rpc-api" | ||
version.workspace = true | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
katana-core = { path = "../../core" } | ||
katana-primitives = { path = "../../primitives" } | ||
katana-rpc-types = { path = "../rpc-types" } | ||
|
||
jsonrpsee = { workspace = true, features = [ "macros", "server" ] } | ||
starknet.workspace = true | ||
|
||
[features] | ||
client = [ "jsonrpsee/client" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use jsonrpsee::core::RpcResult; | ||
use jsonrpsee::proc_macros::rpc; | ||
use katana_core::accounts::Account; | ||
use katana_primitives::FieldElement; | ||
|
||
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "katana"))] | ||
#[cfg_attr(feature = "client", rpc(client, server, namespace = "katana"))] | ||
pub trait KatanaApi { | ||
#[method(name = "generateBlock")] | ||
async fn generate_block(&self) -> RpcResult<()>; | ||
|
||
#[method(name = "nextBlockTimestamp")] | ||
async fn next_block_timestamp(&self) -> RpcResult<u64>; | ||
|
||
#[method(name = "setNextBlockTimestamp")] | ||
async fn set_next_block_timestamp(&self, timestamp: u64) -> RpcResult<()>; | ||
|
||
#[method(name = "increaseNextBlockTimestamp")] | ||
async fn increase_next_block_timestamp(&self, timestamp: u64) -> RpcResult<()>; | ||
|
||
#[method(name = "predeployedAccounts")] | ||
async fn predeployed_accounts(&self) -> RpcResult<Vec<Account>>; | ||
|
||
#[method(name = "setStorageAt")] | ||
async fn set_storage_at( | ||
&self, | ||
contract_address: FieldElement, | ||
key: FieldElement, | ||
value: FieldElement, | ||
) -> RpcResult<()>; | ||
} |
File renamed without changes.
Oops, something went wrong.