summaryrefslogtreecommitdiffstats
path: root/tests/route_tests.rs
diff options
context:
space:
mode:
authorYigit Sever2021-04-16 02:21:10 +0300
committerYigit Sever2021-04-16 02:21:10 +0300
commitbf42107c74aa9277fd7301c960e3e70efafbe046 (patch)
tree5d0e71740b4119006ccce6558fb2a70e9af7e2bb /tests/route_tests.rs
parent93a7ac51bf859bf72d5f3a2da5e1b41cbe53d0b1 (diff)
downloadgradecoin-bf42107c74aa9277fd7301c960e3e70efafbe046.tar.gz
gradecoin-bf42107c74aa9277fd7301c960e3e70efafbe046.tar.bz2
gradecoin-bf42107c74aa9277fd7301c960e3e70efafbe046.zip
Still at block test
Diffstat (limited to 'tests/route_tests.rs')
-rw-r--r--tests/route_tests.rs55
1 files changed, 42 insertions, 13 deletions
diff --git a/tests/route_tests.rs b/tests/route_tests.rs
index 76ea5fc..de60414 100644
--- a/tests/route_tests.rs
+++ b/tests/route_tests.rs
@@ -14,25 +14,54 @@ mod tests {
14 User { 14 User {
15 user_id: MetuId::new("e254275".to_owned(), "DtNX1qk4YF4saRH".to_owned()).unwrap(), 15 user_id: MetuId::new("e254275".to_owned(), "DtNX1qk4YF4saRH".to_owned()).unwrap(),
16 public_key: "-----BEGIN PUBLIC KEY----- 16 public_key: "-----BEGIN PUBLIC KEY-----
17MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4nU0G4WjkmcQUx0hq6LQ 17MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5yWTMeFqr2nvOC9oR5Wq
18uV5Q+ACmUFL/OjoYMDwC/O/6pCd1UZgCfgHN2xEffDPznzcTn8OiFRxr4oWyBiny 18/nzcNlwCIaziojt7rJ4BBvuwkT0tERDz8AgvUsaewiB+Fz5OXTeb3WAB1FEXnBXG
19rUpnY4mhy0SQUwoeCw7YkcHAyhCjNT74aR/ohX0MCj0qRRdbt5ZQXM/GC3HJuXE1 19ekrGzvC8jHQMKHyNoWzUlpQJ9UMtdQIWPOCuMyLpc+rNPL3428U8UpldjbTHHyq2
20ptSuhFgQxziItamn8maoJ6JUSVEXVO1NOrrjoM3r7Q+BK2B+sX4/bLZ+VG5g1q2n 20/ef6abkdj+XWg/slYtrFeOf3ktc1l50R4k8VO8L6kQuh2+YIjXGPLShRaqnUQPtH
21EbFdTHS6pHqtZNHQndTmEKwRfh0RYtzEzOXuO6e1gQY42Tujkof40dhGCIU7TeIG 218LFPX4bO9lJ9mAoMZFec6XVwumn/uqu9jyWQL6qh6gtwQHgN+A9wGvzVvltJ9h8s
22GHwdFxy1niLkXwtHNjV7lnIOkTbx6+sSPamRfQAlZqUWM2Lf5o+7h3qWP3ENB138 22shSHWWtBD0M19ilbXhKyBsHSSZkpx+TAvFhfQ8JURw7KqahUPVlCwJ5OIKccJ/6F
23sQIDAQAB 23FQIDAQAB
24-----END PUBLIC KEY-----" 24-----END PUBLIC KEY-----"
25 .to_owned(), 25 .to_owned(),
26 balance: 30, 26 balance: 30,
27 }, 27 },
28 ); 28 );
29 29
30 // -----BEGIN RSA PRIVATE KEY-----
31// MIIEpAIBAAKCAQEA5yWTMeFqr2nvOC9oR5Wq/nzcNlwCIaziojt7rJ4BBvuwkT0t
32// ERDz8AgvUsaewiB+Fz5OXTeb3WAB1FEXnBXGekrGzvC8jHQMKHyNoWzUlpQJ9UMt
33// dQIWPOCuMyLpc+rNPL3428U8UpldjbTHHyq2/ef6abkdj+XWg/slYtrFeOf3ktc1
34// l50R4k8VO8L6kQuh2+YIjXGPLShRaqnUQPtH8LFPX4bO9lJ9mAoMZFec6XVwumn/
35// uqu9jyWQL6qh6gtwQHgN+A9wGvzVvltJ9h8sshSHWWtBD0M19ilbXhKyBsHSSZkp
36// x+TAvFhfQ8JURw7KqahUPVlCwJ5OIKccJ/6FFQIDAQABAoIBADTZGnZlG4dPqSon
37// bKgxSA83bQHgt3wLkyWUhApLdeCq2wvZ+NvWDG/s7yT11IZ991ZJIJGfjTtoIALz
38// J3rAX8jGH/5gfDuArOb000z9H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/OZqY5gIQ+jlfwqnVg+PDQQ/P09/4xygRCLvjL6NCSvtkj1
55// MRArEl4y68+jZLRu74TVG0lXi6ht6KhNHF6GiWKU9FHZ4B+btLicsg==
56// -----END RSA PRIVATE KEY-----
57
58
30 db.pending_transactions.write().insert( 59 db.pending_transactions.write().insert(
31 "source_public_key_signature".to_owned(), 60 "mock_transaction_source".to_owned(),
32 Transaction { 61 Transaction {
33 by: "source_public_key_signature".to_owned(), 62 by: "mock_transaction_source".to_owned(),
34 source: "source_public_key_signature".to_owned(), 63 source: "31415926535897932384626433832795028841971693993751058209749445923".to_owned(),
35 target: "target_public_key_signature".to_owned(), 64 target: "mock_transaction_source".to_owned(),
36 amount: 3, 65 amount: 3,
37 timestamp: chrono::NaiveDate::from_ymd(2021, 04, 13).and_hms(20, 55, 30), 66 timestamp: chrono::NaiveDate::from_ymd(2021, 04, 13).and_hms(20, 55, 30),
38 }, 67 },
@@ -211,12 +240,12 @@ sQIDAQAB
211 timestamp: chrono::NaiveDate::from_ymd(2021, 04, 13).and_hms(23, 38, 00), 240 timestamp: chrono::NaiveDate::from_ymd(2021, 04, 13).and_hms(23, 38, 00),
212 hash: "0000007c52e4486359f62b2d19781fafaf059bd691bc6d835b666f6eac1d01d9".to_owned(), 241 hash: "0000007c52e4486359f62b2d19781fafaf059bd691bc6d835b666f6eac1d01d9".to_owned(),
213 } ) 242 } )
214 .header("Authorization", "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aGEiOiIyYjY0OGZmYWI1ZDlhZjFkNWQ1ZmMwNTJmYzllNTFiODgyZmM0ZmIwYzk5ODYwOGM5OTIzMmY5MjgyMDAwMDAwIiwiaWF0IjoxNjE4MzYwNjQxLCJleHAiOjE3MTgyNjA2NDF9.P5L_uZ9lOhRZCbsG9GDXn_rmZat3dP9Y2lbk8GY4Kg4pOxJIklBUxot-TtJzB0vEJFcjnxVnT2lFLCgfdQLHTJvURiW0KRHi94e1Kj8aDXxJ0qjlq4-c1JCZnAIbDpvkFtHNKz04yfyeSR2htJ6kOjlqVpeUhLVokHhi1x-ZUZZSpeGnlIXgi-AcmkEoyOypZGSZgQ1hjID2f18zgfbshgPK4Dr0hiN36wYMB0y0YiikRbvDuGgDzRLN2nitih46-CXTGZMqIRz3eAfM2wuUSH1yhdKi5_vavz8L3EPVCGMO-CKlPUDkYA-duQZf_q3tG2fkdaFlTAcCik_kVMprdw") 243 .header("Authorization", "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aGEiOiIwMDAwMDA3YzUyZTQ0ODYzNTlmNjJiMmQxOTc4MWZhZmFmMDU5YmQ2OTFiYzZkODM1YjY2NmY2ZWFjMWQwMWQ5IiwiaWF0IjoxMDAwMDAwMDAwMCwiZXhwIjoxMDkwMDAwMDAwMH0.JrzYlamBnT3qcjttzLTLXpiO5qfBu1e2HjQWueJ8l__aas6I1xq77UO8kCWn2Sm-zwUOI_155Pbd4xAqL6pokjLHZSFnAi9ZJ8cpqgw4ZXdI-Z3tDpZMUSiI018CGMZQZ_BwdGDIBbjEy0P-MX590DW9ofLVZckJKoXU5fFYi47OBegh4-8cchco_Z4wDPVamyhZXo8YmIN_ioSQNBQT2gNJnWsVvsXAQ7IdX9fhwS19t1kdnyk_WlezGbkrQ5xW-XAs4qMCgybbW9ErRwIruxI0PLlILFw2-m-UtH7fGdSIAaG-q6gKy79rPQLEE2kI9I39SVdIfMTadfnu6bduag")
215 .path("/block") 244 .path("/block")
216 .reply(&filter) 245 .reply(&filter)
217 .await; 246 .await;
218 247
219 println!("{:?}, {:?}", res, db.blockchain.read()); 248 println!("ISSUE: {:?}", res.body());
220 249
221 // should be reflectled on the db as well 250 // should be reflectled on the db as well
222 assert_eq!( 251 assert_eq!(