mirror of
https://github.com/LORDBABUINO/stealth.git
synced 2026-06-19 10:19:43 -07:00
refactor(api): remove preflight descriptor validation
The Bitcoin Core node is the authority on descriptor validity. Reimplementing descriptor shape/prefix/checksum checks here creates a divergence risk with the node's own validator and adds maintenance surface for no real safety gain. Invalid descriptors now fail at the node, surfaced through AnalysisError. - delete api/src/preflight.rs and its module declaration - drop ValidationError from ApiError (no remaining producers) - remove the validate() call from the scan handler - drop the two tests that asserted preflight-specific rejection codes
This commit is contained in:
@@ -54,26 +54,6 @@ async fn scan_post_with_valid_descriptor_returns_503_without_rpc() {
|
||||
server.stop().await;
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn scan_post_with_invalid_descriptor_returns_bad_request() {
|
||||
let server = TestServer::spawn().await;
|
||||
let client = reqwest::Client::new();
|
||||
|
||||
let response = client
|
||||
.post(server.url("/api/wallet/scan"))
|
||||
.json(&json!({
|
||||
"descriptor": "123"
|
||||
}))
|
||||
.send()
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(response.status(), StatusCode::BAD_REQUEST);
|
||||
let body: serde_json::Value = response.json().await.unwrap();
|
||||
assert_eq!(body["error"]["code"], "invalid_scan_input");
|
||||
server.stop().await;
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn scan_post_with_descriptors_returns_503_without_rpc() {
|
||||
let server = TestServer::spawn().await;
|
||||
|
||||
Reference in New Issue
Block a user