diff options
author | Yigit Sever | 2021-04-23 01:41:18 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-23 01:41:18 +0300 |
commit | 63d08a9f120e842dcc5a34a1db6b39957c643b30 (patch) | |
tree | 74fc517fb6f6a466806aae02248c5dc7020ee9f3 /tests/route_tests.rs | |
parent | e9bf8a1a85d9366e59ec7989772d4e16490f1273 (diff) | |
download | gradecoin-63d08a9f120e842dcc5a34a1db6b39957c643b30.tar.gz gradecoin-63d08a9f120e842dcc5a34a1db6b39957c643b30.tar.bz2 gradecoin-63d08a9f120e842dcc5a34a1db6b39957c643b30.zip |
[WIP] Done, untested
Diffstat (limited to 'tests/route_tests.rs')
-rw-r--r-- | tests/route_tests.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/route_tests.rs b/tests/route_tests.rs index decc712..cfa1af6 100644 --- a/tests/route_tests.rs +++ b/tests/route_tests.rs | |||
@@ -24,6 +24,7 @@ FQIDAQAB | |||
24 | -----END PUBLIC KEY-----" | 24 | -----END PUBLIC KEY-----" |
25 | .to_owned(), | 25 | .to_owned(), |
26 | balance: 30, | 26 | balance: 30, |
27 | is_bot: false | ||
27 | }, | 28 | }, |
28 | ); | 29 | ); |
29 | 30 | ||
@@ -33,6 +34,7 @@ FQIDAQAB | |||
33 | user_id: MetuId::new("e223715".to_owned(), "1H5QuOYI1b2r9ET".to_owned()).unwrap(), | 34 | user_id: MetuId::new("e223715".to_owned(), "1H5QuOYI1b2r9ET".to_owned()).unwrap(), |
34 | public_key: "NOT_USED_FOR_THIS_USER".to_owned(), | 35 | public_key: "NOT_USED_FOR_THIS_USER".to_owned(), |
35 | balance: 0, | 36 | balance: 0, |
37 | is_bot: false | ||
36 | }, | 38 | }, |
37 | ); | 39 | ); |
38 | 40 | ||
@@ -69,8 +71,7 @@ MRArEl4y68+jZLRu74TVG0lXi6ht6KhNHF6GiWKU9FHZ4B+btLicsg== | |||
69 | db.pending_transactions.write().insert( | 71 | db.pending_transactions.write().insert( |
70 | "fingerprint_of_foo".to_owned(), | 72 | "fingerprint_of_foo".to_owned(), |
71 | Transaction { | 73 | Transaction { |
72 | by: "fingerprint_of_foo".to_owned(), | 74 | source: "fingerprint_of_foo" |
73 | source: "31415926535897932384626433832795028841971693993751058209749445923" | ||
74 | .to_owned(), | 75 | .to_owned(), |
75 | target: "fingerprint_of_foo".to_owned(), | 76 | target: "fingerprint_of_foo".to_owned(), |
76 | amount: 2, | 77 | amount: 2, |
@@ -167,9 +168,8 @@ MRArEl4y68+jZLRu74TVG0lXi6ht6KhNHF6GiWKU9FHZ4B+btLicsg== | |||
167 | let res = warp::test::request() | 168 | let res = warp::test::request() |
168 | .method("POST") | 169 | .method("POST") |
169 | .json(&Transaction { | 170 | .json(&Transaction { |
170 | by: "fingerprint_of_some_guy".to_owned(), | 171 | source: "fingerprint_of_some_guy".to_owned(), |
171 | source: "31415926535897932384626433832795028841971693993751058209749445923".to_owned(), | 172 | target: "31415926535897932384626433832795028841971693993751058209749445923".to_owned(), |
172 | target: "fingerprint_of_some_guy".to_owned(), | ||
173 | amount: 2, | 173 | amount: 2, |
174 | timestamp: chrono::NaiveDate::from_ymd(2021, 04, 13).and_hms(20, 55, 30), | 174 | timestamp: chrono::NaiveDate::from_ymd(2021, 04, 13).and_hms(20, 55, 30), |
175 | }) | 175 | }) |
@@ -200,7 +200,6 @@ MRArEl4y68+jZLRu74TVG0lXi6ht6KhNHF6GiWKU9FHZ4B+btLicsg== | |||
200 | let res = warp::test::request() | 200 | let res = warp::test::request() |
201 | .method("POST") | 201 | .method("POST") |
202 | .json(&Transaction { | 202 | .json(&Transaction { |
203 | by: "some_fingerprint".to_owned(), | ||
204 | source: "some_fingerprint".to_owned(), | 203 | source: "some_fingerprint".to_owned(), |
205 | target: "some_other_fingerprint".to_owned(), | 204 | target: "some_other_fingerprint".to_owned(), |
206 | amount: 2, | 205 | amount: 2, |
@@ -232,10 +231,9 @@ MRArEl4y68+jZLRu74TVG0lXi6ht6KhNHF6GiWKU9FHZ4B+btLicsg== | |||
232 | db.pending_transactions.write().insert( | 231 | db.pending_transactions.write().insert( |
233 | "fingerprint_of_some_guy".to_owned(), | 232 | "fingerprint_of_some_guy".to_owned(), |
234 | Transaction { | 233 | Transaction { |
235 | by: "fingerprint_of_some_guy".to_owned(), | 234 | source: "fingerprint_of_some_guy" |
236 | source: "31415926535897932384626433832795028841971693993751058209749445923" | ||
237 | .to_owned(), | 235 | .to_owned(), |
238 | target: "fingerprint_of_some_guy".to_owned(), | 236 | target: "31415926535897932384626433832795028841971693993751058209749445923".to_owned(), |
239 | amount: 2, | 237 | amount: 2, |
240 | timestamp: chrono::NaiveDate::from_ymd(2021, 04, 13).and_hms(20, 55, 30), | 238 | timestamp: chrono::NaiveDate::from_ymd(2021, 04, 13).and_hms(20, 55, 30), |
241 | }, | 239 | }, |