aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYigit Sever2021-04-17 19:47:39 +0300
committerYigit Sever2021-04-17 19:47:39 +0300
commitcd4214da789df660c5d1d70f390ff164da244335 (patch)
tree83065e654f06d876c227dae960ec7d13f329c94b /tests
parent240355e1df485ca869a9b0074c085d25417bf36c (diff)
downloadgradecoin-cd4214da789df660c5d1d70f390ff164da244335.tar.gz
gradecoin-cd4214da789df660c5d1d70f390ff164da244335.tar.bz2
gradecoin-cd4214da789df660c5d1d70f390ff164da244335.zip
Implement block/tx bounds
Diffstat (limited to 'tests')
-rw-r--r--tests/route_tests.rs10
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