-
Notifications
You must be signed in to change notification settings - Fork 32
GH-662: Clean-up of the obsolete pending payable param in PayableAccount and financials command fix with some SQL work #715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bertllll
wants to merge
12
commits into
GH-598
Choose a base branch
from
GH-662
base: GH-598
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5df011a
GH-662: PayableAccount got the field removed
234d41c
GH-662: mark pending payable functionality removed
a02ea20
GH-662: repaired custom query
afa5e26
GH-662: SQL improved
18fedcf
GH-662: formatting
2bc1bc3
GH-662: interim commit
40f8383
GH-662: CLI fixed
3b624ce
GH-662: complete
3953e50
GH-662: renaming; plus, updated the UI-Node documentation
f355b76
GH-662: formatting
e7b9fba
GH-662: merged in updated GH-598
0734e5b
GH-662: added Eq attr
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -324,8 +324,8 @@ mod tests { | |
| use crate::test_utils::mocks::CommandContextMock; | ||
| use atty::Stream; | ||
| use masq_lib::messages::{ | ||
| ToMessageBody, TopRecordsOrdering, UiFinancialStatistics, UiFinancialsResponse, | ||
| UiPayableAccount, UiReceivableAccount, | ||
| ToMessageBody, TopRecordsOrdering, TxProcessingInfo, UiFinancialStatistics, | ||
| UiFinancialsResponse, UiPayableAccount, UiReceivableAccount, | ||
| }; | ||
| use masq_lib::ui_gateway::MessageBody; | ||
| use masq_lib::utils::slice_of_strs_to_vec_of_strings; | ||
|
|
@@ -1028,15 +1028,27 @@ mod tests { | |
| wallet: "0xA884A2F1A5Ec6C2e499644666a5E6af97B966888".to_string(), | ||
| age_s: 5645405400, | ||
| balance_gwei: 68843325667, | ||
| pending_payable_hash_opt: None, | ||
| tx_processing_info_opt: None, | ||
| }, | ||
| UiPayableAccount { | ||
| wallet: "0x6DbcCaC5596b7ac986ff8F7ca06F212aEB444440".to_string(), | ||
| age_s: 150000, | ||
| balance_gwei: 8, | ||
| pending_payable_hash_opt: Some( | ||
| "0x0290db1d56121112f4d45c1c3f36348644f6afd20b759b762f1dba9c4949066e" | ||
| .to_string(), | ||
| balance_gwei: 999888777, | ||
| tx_processing_info_opt: Some(TxProcessingInfo{pending_tx_hash_opt: Some("0x0290db1d56121112f4d45c1c3f36348644f6afd20b759b762f1dba9c4949066e".to_string()),failures: 0} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to me, the inner Some shouldn't exist, tx hash should be a compulsory value. |
||
| ), | ||
| }, | ||
| UiPayableAccount { | ||
| wallet: "0x563cCaC5596b7ac986ff8F7ca056789a122c3230".to_string(), | ||
| age_s: 12055, | ||
| balance_gwei: 33444555, | ||
| tx_processing_info_opt: Some(TxProcessingInfo{pending_tx_hash_opt: None,failures: 3} | ||
| ), | ||
| }, | ||
| UiPayableAccount { | ||
| wallet: "0xeF456a11A5Ec6C2e499655787a5E6af97c961123".to_string(), | ||
| age_s: 161514, | ||
| balance_gwei: 1111, | ||
| tx_processing_info_opt: Some(TxProcessingInfo{pending_tx_hash_opt: Some("0xb45a663d56121112f4d45c1c3a245be32eAA6afd20b759b762f1dba945ec2f41".to_string()),failures: 1} | ||
| ), | ||
| }, | ||
| ]), | ||
|
|
@@ -1059,9 +1071,9 @@ mod tests { | |
| wallet: "0x6DbcCaC5596b7ac986ff8F7ca06F212aEB444440".to_string(), | ||
| age_s: 150000, | ||
| balance_gwei: 8, | ||
| pending_payable_hash_opt: Some( | ||
| tx_processing_info_opt: Some(TxProcessingInfo{pending_tx_hash_opt: Some( | ||
| "0x0290db1d56121112f4d45c1c3f36348644f6afd20b759b762f1dba9c4949066e" | ||
| .to_string(), | ||
| .to_string()),failures: 0} | ||
| ), | ||
| }]), | ||
| receivable_opt: None, | ||
|
|
@@ -1117,9 +1129,11 @@ mod tests { | |
| \n\ | ||
| Payable\n\ | ||
| \n\ | ||
| # Wallet Age [s] Balance [MASQ] Pending tx \n\ | ||
| 1 0xA884A2F1A5Ec6C2e499644666a5E6af97B966888 5,645,405,400 68.84 None \n\ | ||
| 2 0x6DbcCaC5596b7ac986ff8F7ca06F212aEB444440 150,000 < 0.01 0x0290db1d56121112f4d45c1c3f36348644f6afd20b759b762f1dba9c4949066e\n\ | ||
| # Wallet Age [s] Balance [MASQ] Pending tx \n\ | ||
| 1 0xA884A2F1A5Ec6C2e499644666a5E6af97B966888 5,645,405,400 68.84 None \n\ | ||
| 2 0x6DbcCaC5596b7ac986ff8F7ca06F212aEB444440 150,000 0.99 0x0290db1d56121112f4d45c1c3f36348644f6afd20b759b762f1dba9c4949066e \n\ | ||
| 3 0x563cCaC5596b7ac986ff8F7ca056789a122c3230 12,055 0.03 Processing... 3 failed attempts \n\ | ||
| 4 0xeF456a11A5Ec6C2e499655787a5E6af97c961123 161,514 < 0.01 0xb45a663d56121112f4d45c1c3a245be32eAA6afd20b759b762f1dba945ec2f41 (1 failed attempt)\n\ | ||
| \n\ | ||
| \n\ | ||
| \n\ | ||
|
|
@@ -1253,9 +1267,11 @@ mod tests { | |
| \n\ | ||
| Payable\n\ | ||
| \n\ | ||
| # Wallet Age [s] Balance [gwei] Pending tx \n\ | ||
| 1 0xA884A2F1A5Ec6C2e499644666a5E6af97B966888 5,645,405,400 68,843,325,667 None \n\ | ||
| 2 0x6DbcCaC5596b7ac986ff8F7ca06F212aEB444440 150,000 8 0x0290db1d56121112f4d45c1c3f36348644f6afd20b759b762f1dba9c4949066e\n\ | ||
| # Wallet Age [s] Balance [gwei] Pending tx \n\ | ||
| 1 0xA884A2F1A5Ec6C2e499644666a5E6af97B966888 5,645,405,400 68,843,325,667 None \n\ | ||
| 2 0x6DbcCaC5596b7ac986ff8F7ca06F212aEB444440 150,000 999,888,777 0x0290db1d56121112f4d45c1c3f36348644f6afd20b759b762f1dba9c4949066e \n\ | ||
| 3 0x563cCaC5596b7ac986ff8F7ca056789a122c3230 12,055 33,444,555 Processing... 3 failed attempts \n\ | ||
| 4 0xeF456a11A5Ec6C2e499655787a5E6af97c961123 161,514 1,111 0xb45a663d56121112f4d45c1c3a245be32eAA6afd20b759b762f1dba945ec2f41 (1 failed attempt)\n\ | ||
| \n\ | ||
| \n\ | ||
| \n\ | ||
|
|
@@ -1345,25 +1361,26 @@ mod tests { | |
| #[test] | ||
| fn custom_query_balance_range_can_be_shorthanded() { | ||
| let transact_params_arc = Arc::new(Mutex::new(vec![])); | ||
| let expected_response = UiFinancialsResponse { | ||
| stats_opt: None, | ||
| query_results_opt: Some(QueryResults { | ||
| payable_opt: Some(vec![UiPayableAccount { | ||
| let expected_response = | ||
| UiFinancialsResponse { | ||
| stats_opt: None, | ||
| query_results_opt: Some(QueryResults { | ||
| payable_opt: Some(vec![UiPayableAccount { | ||
| wallet: "0x6DbcCaC5596b7ac986ff8F7ca06F212aEB444440".to_string(), | ||
| age_s: 150000, | ||
| balance_gwei: 1200000000000, | ||
| pending_payable_hash_opt: Some( | ||
| tx_processing_info_opt: Some(TxProcessingInfo{pending_tx_hash_opt: Some( | ||
| "0x0290db1d56121112f4d45c1c3f36348644f6afd20b759b762f1dba9c4949066e" | ||
| .to_string(), | ||
| .to_string()),failures: 4} | ||
| ), | ||
| }]), | ||
| receivable_opt: Some(vec![UiReceivableAccount { | ||
| wallet: "0x8bA50675e590b545D2128905b89039256Eaa24F6".to_string(), | ||
| age_s: 45700, | ||
| balance_gwei: 5050330000, | ||
| }]), | ||
| }), | ||
| }; | ||
| receivable_opt: Some(vec![UiReceivableAccount { | ||
| wallet: "0x8bA50675e590b545D2128905b89039256Eaa24F6".to_string(), | ||
| age_s: 45700, | ||
| balance_gwei: 5050330000, | ||
| }]), | ||
| }), | ||
| }; | ||
| let args = slice_of_strs_to_vec_of_strings(&[ | ||
| "financials", | ||
| "--payable", | ||
|
|
@@ -1411,8 +1428,8 @@ mod tests { | |
| "\n\ | ||
| Specific payable query: 0-350000 sec 5-UNLIMITED MASQ\n\ | ||
| \n\ | ||
| # Wallet Age [s] Balance [MASQ] Pending tx \n\ | ||
| 1 0x6DbcCaC5596b7ac986ff8F7ca06F212aEB444440 150,000 1,200.00 0x0290db1d56121112f4d45c1c3f36348644f6afd20b759b762f1dba9c4949066e\n\ | ||
| # Wallet Age [s] Balance [MASQ] Pending tx \n\ | ||
| 1 0x6DbcCaC5596b7ac986ff8F7ca06F212aEB444440 150,000 1,200.00 0x0290db1d56121112f4d45c1c3f36348644f6afd20b759b762f1dba9c4949066e (4 failed attempts)\n\ | ||
| \n\ | ||
| \n\ | ||
| \n\ | ||
|
|
@@ -1603,16 +1620,16 @@ mod tests { | |
| wallet: "0xA884A2F1A5Ec6C2e499644666a5E6af97B966888".to_string(), | ||
| age_s: 5405400, | ||
| balance_gwei: 644000000, | ||
| pending_payable_hash_opt: Some( | ||
| tx_processing_info_opt: Some(TxProcessingInfo{pending_tx_hash_opt: Some( | ||
| "0x3648c8b8c7e067ac30b80b6936159326d564dd13b7ae465b26647154ada2c638" | ||
| .to_string(), | ||
| .to_string()), failures: 0} | ||
| ), | ||
| }, | ||
| UiPayableAccount { | ||
| wallet: "0xEA674fdac714fd979de3EdF0F56AA9716B198ec8".to_string(), | ||
| age_s: 28120444, | ||
| balance_gwei: 97524120, | ||
| pending_payable_hash_opt: None, | ||
| tx_processing_info_opt: None, | ||
| }, | ||
| ]), | ||
| receivable_opt: Some(vec![ | ||
|
|
@@ -1689,22 +1706,22 @@ mod tests { | |
| wallet: "0x6e250504DdfFDb986C4F0bb8Df162503B4118b05".to_string(), | ||
| age_s: 4445, | ||
| balance_gwei: 3862654858938090, | ||
| pending_payable_hash_opt: Some( | ||
| tx_processing_info_opt: Some( TxProcessingInfo{pending_tx_hash_opt: Some( | ||
| "0x5fe272ed1e941cc05fbd624ec4b1546cd03c25d53e24ba2c18b11feb83cd4581" | ||
| .to_string(), | ||
| .to_string()),failures: 0} | ||
| ), | ||
| }, | ||
| UiPayableAccount { | ||
| wallet: "0xA884A2F1A5Ec6C2e499644666a5E6af97B966888".to_string(), | ||
| age_s: 70000, | ||
| balance_gwei: 708090, | ||
| pending_payable_hash_opt: None, | ||
| tx_processing_info_opt: Some(TxProcessingInfo{pending_tx_hash_opt: None, failures: 3}), | ||
| }, | ||
| UiPayableAccount { | ||
| wallet: "0x6DbcCaC5596b7ac986ff8F7ca06F212aEB444440".to_string(), | ||
| age_s: 6089909, | ||
| balance_gwei: 66658, | ||
| pending_payable_hash_opt: None, | ||
| tx_processing_info_opt: None, | ||
| }, | ||
| ]), | ||
| receivable_opt: None, | ||
|
|
@@ -1754,7 +1771,7 @@ mod tests { | |
| \n\ | ||
| # Wallet Age [s] Balance [MASQ] Pending tx \n\ | ||
| 1 0x6e250504DdfFDb986C4F0bb8Df162503B4118b05 4,445 3,862,654.85 0x5fe272ed1e941cc05fbd624ec4b1546cd03c25d53e24ba2c18b11feb83cd4581\n\ | ||
| 2 0xA884A2F1A5Ec6C2e499644666a5E6af97B966888 70,000 < 0.01 None \n\ | ||
| 2 0xA884A2F1A5Ec6C2e499644666a5E6af97B966888 70,000 < 0.01 Processing... 3 failed attempts \n\ | ||
| 3 0x6DbcCaC5596b7ac986ff8F7ca06F212aEB444440 6,089,909 < 0.01 None \n" | ||
| ); | ||
| assert_eq!(stderr_arc.lock().unwrap().get_string(), String::new()); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case is bit confusing, we should always have a transaction hash, as it is generated locally.