You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let valid_response = vec![76,68,75,2,2,174,0,0,111,226,140,10,182,241,179,114,193,166,162,70,174,99,247,79,147,30,131,101,225,90,8,156,104,214,25,0,0,0,0,0,8,153,192,0,2,27,0,0,2,22,7,207,206,25,164,197,231,230,231,56,102,61,250,251,187,172,38,46,79,247,108,44,155,48,219,238,252,53,192,6,67,2,36,125,157,176,223,175,234,116,94,248,201,225,97,235,50,47,115,172,63,136,88,216,115,11,111,217,114,84,116,124,231,107,2,163,216,116,204,120,152,52,172,208,143,140,71,242,209,153,111,23,61,222,28,106,198,149,87,166,201,180,51,64,252,143,166,2,57,240,15,230,190,255,224,70,176,137,155,249,125,20,170,114,97,221,142,89,231,233,205,126,199,216,149,155,0,210,45,67,174,0,0,111,226,140,10,182,241,179,114,193,166,162,70,174,99,247,79,147,30,131,101,225,90,8,156,104,214,25,0,0,0,0,0,10,222,162,0,8,38,0,1,2,158,1,242,121,152,106,204,131,186,35,93,70,216,10,237,224,183,89,95,65,3,83,185,58,138,181,64,187,103,127,68,50,2,201,19,17,138,136,149,185,226,156,137,175,110,32,237,0,217,90,31,100,228,149,46,219,175,168,77,4,143,38,128,76,97,2,155,9,173,229,75,82,137,57,21,112,207,99,92,145,58,48,229,10,228,163,3,106,147,39,177,90,242,186,249,11,210,54,2,212,16,225,46,42,209,254,11,28,254,196,167,139,164,241,7,176,120,192,199,148,152,38,17,118,41,122,240,223,249,158,145,2,8,153,192,0,2,27,0,0,1,27,1,0,40,0,0,0,0,0,0,3,232,0,0,0,1,0,0,0,125,0,0,0,0,58,85,116,216,10,222,162,0,8,38,0,1,1,27,1,0,40,0,0,0,0,0,0,3,232,0,0,3,232,0,0,0,1,0,0,0,0,29,129,25,192];
let binary_response = client.get::<BinaryResponse>("/foo","foo.com").await.unwrap();
191
+
let binary_response = client
192
+
.get::<BinaryResponse>("/foo","foo.com")
193
+
.await
194
+
.unwrap();
151
195
assert_eq!(binary_response.0, valid_response);
152
196
}
153
197
154
198
#[tokio::test]
155
199
asyncfnhttp_sync_fails_on_server_error(){
156
-
let valid_response = vec![76,68,75,2,2,174,0,0,111,226,140,10,182,241,179,114,193,166,162,70,174,99,247,79,147,30,131,101,225,90,8,156,104,214,25,0,0,0,0,0,8,153,192,0,2,27,0,0,2,22,7,207,206,25,164,197,231,230,231,56,102,61,250,251,187,172,38,46,79,247,108,44,155,48,219,238,252,53,192,6,67,2,36,125,157,176,223,175,234,116,94,248,201,225,97,235,50,47,115,172,63,136,88,216,115,11,111,217,114,84,116,124,231,107,2,163,216,116,204,120,152,52,172,208,143,140,71,242,209,153,111,23,61,222,28,106,198,149,87,166,201,180,51,64,252,143,166,2,57,240,15,230,190,255,224,70,176,137,155,249,125,20,170,114,97,221,142,89,231,233,205,126,199,216,149,155,0,210,45,67,174,0,0,111,226,140,10,182,241,179,114,193,166,162,70,174,99,247,79,147,30,131,101,225,90,8,156,104,214,25,0,0,0,0,0,10,222,162,0,8,38,0,1,2,158,1,242,121,152,106,204,131,186,35,93,70,216,10,237,224,183,89,95,65,3,83,185,58,138,181,64,187,103,127,68,50,2,201,19,17,138,136,149,185,226,156,137,175,110,32,237,0,217,90,31,100,228,149,46,219,175,168,77,4,143,38,128,76,97,2,155,9,173,229,75,82,137,57,21,112,207,99,92,145,58,48,229,10,228,163,3,106,147,39,177,90,242,186,249,11,210,54,2,212,16,225,46,42,209,254,11,28,254,196,167,139,164,241,7,176,120,192,199,148,152,38,17,118,41,122,240,223,249,158,145,2,8,153,192,0,2,27,0,0,1,27,1,0,40,0,0,0,0,0,0,3,232,0,0,0,1,0,0,0,125,0,0,0,0,58,85,116,216,10,222,162,0,8,38,0,1,1,27,1,0,40,0,0,0,0,0,0,3,232,0,0,3,232,0,0,0,1,0,0,0,0,29,129,25,192];
let server = HttpServer::responding_with_server_error(&valid_response[..]);
158
225
159
226
let block_hash = genesis_block(Network::Bitcoin).block_hash();
@@ -186,7 +253,19 @@ mod tests {
186
253
187
254
#[tokio::test]
188
255
asyncfntest_http_request(){
189
-
let valid_response = vec![76,68,75,2,2,174,0,0,111,226,140,10,182,241,179,114,193,166,162,70,174,99,247,79,147,30,131,101,225,90,8,156,104,214,25,0,0,0,0,0,8,153,192,0,2,27,0,0,2,22,7,207,206,25,164,197,231,230,231,56,102,61,250,251,187,172,38,46,79,247,108,44,155,48,219,238,252,53,192,6,67,2,36,125,157,176,223,175,234,116,94,248,201,225,97,235,50,47,115,172,63,136,88,216,115,11,111,217,114,84,116,124,231,107,2,163,216,116,204,120,152,52,172,208,143,140,71,242,209,153,111,23,61,222,28,106,198,149,87,166,201,180,51,64,252,143,166,2,57,240,15,230,190,255,224,70,176,137,155,249,125,20,170,114,97,221,142,89,231,233,205,126,199,216,149,155,0,210,45,67,174,0,0,111,226,140,10,182,241,179,114,193,166,162,70,174,99,247,79,147,30,131,101,225,90,8,156,104,214,25,0,0,0,0,0,10,222,162,0,8,38,0,1,2,158,1,242,121,152,106,204,131,186,35,93,70,216,10,237,224,183,89,95,65,3,83,185,58,138,181,64,187,103,127,68,50,2,201,19,17,138,136,149,185,226,156,137,175,110,32,237,0,217,90,31,100,228,149,46,219,175,168,77,4,143,38,128,76,97,2,155,9,173,229,75,82,137,57,21,112,207,99,92,145,58,48,229,10,228,163,3,106,147,39,177,90,242,186,249,11,210,54,2,212,16,225,46,42,209,254,11,28,254,196,167,139,164,241,7,176,120,192,199,148,152,38,17,118,41,122,240,223,249,158,145,2,8,153,192,0,2,27,0,0,1,27,1,0,40,0,0,0,0,0,0,3,232,0,0,0,1,0,0,0,125,0,0,0,0,58,85,116,216,10,222,162,0,8,38,0,1,1,27,1,0,40,0,0,0,0,0,0,3,232,0,0,3,232,0,0,0,1,0,0,0,0,29,129,25,192];
let valid_response = vec![76,68,75,2,2,174,0,0,111,226,140,10,182,241,179,114,193,166,162,70,174,99,247,79,147,30,131,101,225,90,8,156,104,214,25,0,0,0,0,0,8,153,192,0,2,27,0,0,2,22,7,207,206,25,164,197,231,230,231,56,102,61,250,251,187,172,38,46,79,247,108,44,155,48,219,238,252,53,192,6,67,2,36,125,157,176,223,175,234,116,94,248,201,225,97,235,50,47,115,172,63,136,88,216,115,11,111,217,114,84,116,124,231,107,2,163,216,116,204,120,152,52,172,208,143,140,71,242,209,153,111,23,61,222,28,106,198,149,87,166,201,180,51,64,252,143,166,2,57,240,15,230,190,255,224,70,176,137,155,249,125,20,170,114,97,221,142,89,231,233,205,126,199,216,149,155,0,210,45,67,174,0,0,111,226,140,10,182,241,179,114,193,166,162,70,174,99,247,79,147,30,131,101,225,90,8,156,104,214,25,0,0,0,0,0,10,222,162,0,8,38,0,1,2,158,1,242,121,152,106,204,131,186,35,93,70,216,10,237,224,183,89,95,65,3,83,185,58,138,181,64,187,103,127,68,50,2,201,19,17,138,136,149,185,226,156,137,175,110,32,237,0,217,90,31,100,228,149,46,219,175,168,77,4,143,38,128,76,97,2,155,9,173,229,75,82,137,57,21,112,207,99,92,145,58,48,229,10,228,163,3,106,147,39,177,90,242,186,249,11,210,54,2,212,16,225,46,42,209,254,11,28,254,196,167,139,164,241,7,176,120,192,199,148,152,38,17,118,41,122,240,223,249,158,145,2,8,153,192,0,2,27,0,0,1,27,1,0,40,0,0,0,0,0,0,3,232,0,0,0,1,0,0,0,125,0,0,0,0,58,85,116,216,10,222,162,0,8,38,0,1,1,27,1,0,40,0,0,0,0,0,0,3,232,0,0,3,232,0,0,0,1,0,0,0,0,29,129,25,192];
0 commit comments