Skip to content

Commit

Permalink
remove endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
drspacemn committed Nov 29, 2023
1 parent fbe02a8 commit c9764b9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ cargo build
cargo run -p beerus-cli -- -c examples/conf/beerus.toml

# wait for server to start
hurl examples/rpc/starknet_provenStateRoot.hurl
hurl examples/rpc/starknet_getStateRoot.hurl
```

### Examples
Expand Down Expand Up @@ -169,8 +169,7 @@ Here are all the endpoints supported by Beerus in tag v0.2.0
| `starknet_chainId` | :white_check_mark: |
| `starknet_pendingTransactions` | :white_check_mark: |
| `starknet_syncing` | :white_check_mark: |
| `starknet_provenStateRoot` | :white_check_mark: |
| `starknet_provenBlockNumber` | :white_check_mark: |
| `starknet_getStateRoot` | :white_check_mark: |
| `starknet_getBalance` | :white_check_mark: |
| `starknet_syncing` | :white_check_mark: |
| `starknet_getEvents` | :x: |
Expand Down
13 changes: 3 additions & 10 deletions crates/rpc/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,8 @@ pub trait BeerusRpc {
keys: Vec<FieldElement>,
) -> Result<StorageProof, BeerusRpcError>;

#[method(name = "provenStateRoot")]
async fn proven_state_root(&self) -> Result<FieldElement, BeerusRpcError>;

#[method(name = "provenBlockNumber")]
async fn proven_block_number(&self) -> Result<u64, BeerusRpcError>;
#[method(name = "getStateRoot")]
async fn get_state_root(&self) -> Result<FieldElement, BeerusRpcError>;

#[method(name = "getBalance")]
async fn get_balance(
Expand Down Expand Up @@ -374,14 +371,10 @@ impl BeerusRpcServer for BeerusRpc {
self.beerus.get_contract_storage_proof(block_id, &contract_address, &keys).await.map_err(BeerusRpcError::from)
}

async fn proven_state_root(&self) -> Result<FieldElement, BeerusRpcError> {
async fn get_state_root(&self) -> Result<FieldElement, BeerusRpcError> {
self.beerus.sn_state_root().await.map_err(BeerusRpcError::from)
}

async fn proven_block_number(&self) -> Result<u64, BeerusRpcError> {
self.beerus.sn_state_block_number().await.map_err(BeerusRpcError::from)
}

async fn get_balance(
&self,
block_id: BlockId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ POST http://0.0.0.0:3030
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "starknet_provenStateRoot",
"method": "starknet_getBlockNumber",
"params": [],
"id": 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ POST http://0.0.0.0:3030
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "starknet_provenBlockNumber",
"method": "starknet_getStateRoot",
"params": [],
"id": 1
}
Expand Down

0 comments on commit c9764b9

Please sign in to comment.