diff options
author | Yigit Sever | 2021-04-17 19:47:39 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-17 19:47:39 +0300 |
commit | 9ead8e1ffa7bc8619aa7a1fd5802538ed927581e (patch) | |
tree | 1bc066c9a9e82dd1d6b43b6e01f286516f53c527 /tests/route_tests.rs | |
parent | 1ec0207d85648c3d7bce9b71b7a22ec081b3f137 (diff) | |
download | gradecoin-9ead8e1ffa7bc8619aa7a1fd5802538ed927581e.tar.gz gradecoin-9ead8e1ffa7bc8619aa7a1fd5802538ed927581e.tar.bz2 gradecoin-9ead8e1ffa7bc8619aa7a1fd5802538ed927581e.zip |
Implement block/tx bounds
Diffstat (limited to 'tests/route_tests.rs')
-rw-r--r-- | tests/route_tests.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/route_tests.rs b/tests/route_tests.rs index 3d8b7f4..3125bc8 100644 --- a/tests/route_tests.rs +++ b/tests/route_tests.rs | |||
@@ -80,7 +80,7 @@ FQIDAQAB | |||
80 | source: "31415926535897932384626433832795028841971693993751058209749445923" | 80 | source: "31415926535897932384626433832795028841971693993751058209749445923" |
81 | .to_owned(), | 81 | .to_owned(), |
82 | target: "mock_transaction_source".to_owned(), | 82 | target: "mock_transaction_source".to_owned(), |
83 | amount: 3, | 83 | amount: 2, |
84 | timestamp: chrono::NaiveDate::from_ymd(2021, 04, 13).and_hms(20, 55, 30), | 84 | timestamp: chrono::NaiveDate::from_ymd(2021, 04, 13).and_hms(20, 55, 30), |
85 | }, | 85 | }, |
86 | ); | 86 | ); |
@@ -105,7 +105,7 @@ FQIDAQAB | |||
105 | by: "mock_transaction_source".to_owned(), | 105 | by: "mock_transaction_source".to_owned(), |
106 | source: "mock_transaction_source".to_owned(), | 106 | source: "mock_transaction_source".to_owned(), |
107 | target: "mock_transaction_target".to_owned(), | 107 | target: "mock_transaction_target".to_owned(), |
108 | amount: 25, | 108 | amount: 2, |
109 | timestamp: chrono::NaiveDate::from_ymd(2021, 04, 09).and_hms(14, 30, 00), | 109 | timestamp: chrono::NaiveDate::from_ymd(2021, 04, 09).and_hms(14, 30, 00), |
110 | } | 110 | } |
111 | } | 111 | } |
@@ -114,11 +114,10 @@ FQIDAQAB | |||
114 | by: "mock_transaction_source2".to_owned(), | 114 | by: "mock_transaction_source2".to_owned(), |
115 | source: "mock_transaction_source2".to_owned(), | 115 | source: "mock_transaction_source2".to_owned(), |
116 | target: "mock_transaction_target".to_owned(), | 116 | target: "mock_transaction_target".to_owned(), |
117 | amount: 25, | 117 | amount: 2, |
118 | timestamp: chrono::NaiveDate::from_ymd(2021, 04, 09).and_hms(14, 30, 00), | 118 | timestamp: chrono::NaiveDate::from_ymd(2021, 04, 09).and_hms(14, 30, 00), |
119 | } | 119 | } |
120 | } | 120 | } |
121 | // r#"{"by":"mock_transaction_source","source":"mock_transaction_source","target":"mock_transaction_target","amount":25,"timestamp":"2021-04-09T14:30:00"}"# | ||
122 | 121 | ||
123 | /// Test simple GET request to /transaction, an endpoint that exists | 122 | /// Test simple GET request to /transaction, an endpoint that exists |
124 | /// https://tools.ietf.org/html/rfc7231#section-6.3.1 | 123 | /// https://tools.ietf.org/html/rfc7231#section-6.3.1 |
@@ -137,7 +136,7 @@ FQIDAQAB | |||
137 | 136 | ||
138 | assert_eq!(res.status(), StatusCode::OK); | 137 | assert_eq!(res.status(), StatusCode::OK); |
139 | 138 | ||
140 | let expected_json_body = r#"{"mock_transaction_source":{"by":"mock_transaction_source","source":"31415926535897932384626433832795028841971693993751058209749445923","target":"mock_transaction_source","amount":3,"timestamp":"2021-04-13T20:55:30"}}"#; | 139 | let expected_json_body = r#"{"mock_transaction_source":{"by":"mock_transaction_source","source":"31415926535897932384626433832795028841971693993751058209749445923","target":"mock_transaction_source","amount":2,"timestamp":"2021-04-13T20:55:30"}}"#; |
141 | 140 | ||
142 | assert_eq!(res.body(), expected_json_body); | 141 | assert_eq!(res.body(), expected_json_body); |
143 | } | 142 | } |
@@ -242,7 +241,6 @@ FQIDAQAB | |||
242 | /// the block | 241 | /// the block |
243 | #[tokio::test] | 242 | #[tokio::test] |
244 | async fn post_block_auth_201() { | 243 | async fn post_block_auth_201() { |
245 | println!("Wtf"); | ||
246 | let db = mocked_db(); | 244 | let db = mocked_db(); |
247 | let filter = consensus_routes(db.clone()); | 245 | let filter = consensus_routes(db.clone()); |
248 | 246 | ||