Skip to content

Commit ebc89e6

Browse files
committed
Add router regression test
1 parent df2fce3 commit ebc89e6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

crates/sdk/src/queries/router.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,25 @@ mod test {
10441044
let result = TEST_RPC.handle(ctx, &request);
10451045
assert!(result.is_err());
10461046

1047+
// Test request with another invalid path.
1048+
// The key difference here is that we are testing
1049+
// an invalid path in a nested segment.
1050+
let request = RequestQuery {
1051+
path: "/b/4".to_owned(),
1052+
data: Default::default(),
1053+
height: block::Height::from(0_u32),
1054+
prove: Default::default(),
1055+
};
1056+
let ctx = RequestCtx {
1057+
event_log: &client.event_log,
1058+
wl_storage: &client.wl_storage,
1059+
vp_wasm_cache: (),
1060+
tx_wasm_cache: (),
1061+
storage_read_past_height_limit: None,
1062+
};
1063+
let result = TEST_RPC.handle(ctx, &request);
1064+
assert!(result.is_err());
1065+
10471066
// Test request with a non-ascii path
10481067
let request = RequestQuery {
10491068
path: "ÀÁõö÷øùúûüýþÿ".to_owned(),

0 commit comments

Comments
 (0)