Skip to content
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

feat(katana): modify DevApi trait with new endpoints #2490

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5347bc3
Modify DevApi trait with new endpoints
fabrobles92 Oct 1, 2024
75155c0
Implementation of account_balance method
fabrobles92 Oct 3, 2024
e2612e3
clippy.sh and rust_fmt.sh
fabrobles92 Oct 3, 2024
9902cfe
Replace RPC call with querying the storage directly
fabrobles92 Oct 11, 2024
b2e3ad4
-Re implement proxy_get_request.rs
fabrobles92 Oct 22, 2024
3947795
cargo fmt
fabrobles92 Oct 22, 2024
c23d9eb
Merge branch 'main' into feat/expose_dev_endpoints
fabrobles92 Oct 23, 2024
5a3865c
update cargo.lock
fabrobles92 Oct 30, 2024
8c4a8b8
Merge branch 'main' into feat/expose_dev_endpoints
fabrobles92 Oct 30, 2024
8e08862
Keep ProxyGetRequestLayer for / (health) endpoint
fabrobles92 Oct 30, 2024
e4666bc
Enable query param contract_address for endpoint account_balance
fabrobles92 Oct 31, 2024
0bf530d
Merge branch 'main' into feat/expose_dev_endpoints
fabrobles92 Oct 31, 2024
3ec9a5e
cargo fmt
fabrobles92 Oct 31, 2024
378ae06
Remove unused files
fabrobles92 Dec 7, 2024
9411eb5
Update cargo
fabrobles92 Dec 7, 2024
23cd841
Merge branch 'main' into feat/expose_dev_endpoints
fabrobles92 Dec 7, 2024
8e61aa4
- Accepting unit param
fabrobles92 Dec 13, 2024
0f2380d
Merge branch 'main' into feat/expose_dev_endpoints
fabrobles92 Dec 13, 2024
01f69c2
Fix cargo, removing duplicates
fabrobles92 Dec 13, 2024
78c2180
Implement Devnet Proxy Layer in new implementation
fabrobles92 Dec 13, 2024
1aafb25
Merge branch 'main' into feat/expose_dev_endpoints
fabrobles92 Jan 3, 2025
c8d2444
Clean unused code
fabrobles92 Jan 3, 2025
2cb90f1
clippy.sh
fabrobles92 Jan 3, 2025
0c14c03
rust_fmt.sh
fabrobles92 Jan 4, 2025
3d73532
Fix default case in match and early return when invalid route provided
fabrobles92 Jan 4, 2025
17a53b5
Fix error when returning response when route is not known in DevnetPr…
fabrobles92 Jan 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions crates/katana/rpc/rpc-api/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,15 @@ pub trait DevApi {

#[method(name = "predeployedAccounts")]
async fn predeployed_accounts(&self) -> RpcResult<Vec<Account>>;

#[method(name = "accountBalance")]
async fn account_balance (&self, contract_address: Felt) -> RpcResult<u64>;

#[method(name = "feeToken")]
async fn fee_token (&self) -> RpcResult<u64>;

#[method(name = "mint")]
async fn mint (&self) -> RpcResult<()>;


}
12 changes: 12 additions & 0 deletions crates/katana/rpc/rpc/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@
Ok(())
}

async fn account_balance(&self, _contract_address: Felt) -> Result<u64, Error> {
Ok(1)
}

Check warning on line 97 in crates/katana/rpc/rpc/src/dev.rs

View check run for this annotation

Codecov / codecov/patch

crates/katana/rpc/rpc/src/dev.rs#L95-L97

Added lines #L95 - L97 were not covered by tests

async fn fee_token(&self,) -> Result<u64, Error> {
Ok(1)
}

Check warning on line 101 in crates/katana/rpc/rpc/src/dev.rs

View check run for this annotation

Codecov / codecov/patch

crates/katana/rpc/rpc/src/dev.rs#L99-L101

Added lines #L99 - L101 were not covered by tests

async fn mint(&self) -> Result<(), Error> {
Ok(())
}

Check warning on line 105 in crates/katana/rpc/rpc/src/dev.rs

View check run for this annotation

Codecov / codecov/patch

crates/katana/rpc/rpc/src/dev.rs#L103-L105

Added lines #L103 - L105 were not covered by tests

#[allow(deprecated)]
async fn predeployed_accounts(&self) -> Result<Vec<Account>, Error> {
Ok(self.backend.config.genesis.accounts().map(|e| Account::new(*e.0, e.1)).collect())
Expand Down
Loading