Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
266 commits
Select commit Hold shift + click to select a range
6d14150
GH-605: ability to migrate transactions from the SentPayable Table to…
utkarshg6 Jul 11, 2025
f84ecf9
GH-605: add helper function join_with_separator
utkarshg6 Jul 11, 2025
553f725
GH-605: use join_with_separator inside failed_payable_dao
utkarshg6 Jul 11, 2025
d17b7fc
GH-605: use join_with_separator inside sent_payable_dao
utkarshg6 Jul 11, 2025
5cdfb5c
GH-605: use the HashSet instead of Vector for RetrieveCondition
utkarshg6 Jul 11, 2025
2325da6
GH-605: all good but insert_new_records_throws_error_when_two_txs_wit…
utkarshg6 Jul 11, 2025
ec41f25
GH-605: sort the inputs as the first thing
utkarshg6 Jul 11, 2025
71c4678
GH-605: introduce TODOs for converting Vectors to HashSet
utkarshg6 Jul 14, 2025
928a02b
GH-605: finish test payable_scanner_is_facing_failed_transactions_and…
utkarshg6 Jul 14, 2025
0715e9b
GH-605: add better logging
utkarshg6 Jul 15, 2025
e068941
GH-605: further improvements in migrating failures
utkarshg6 Jul 15, 2025
1c7314d
GH-605: add test retrieve_txs_by_hash_returns_only_existing_transactions
utkarshg6 Jul 15, 2025
418cb73
GH-605: clean implementation of payables migration
utkarshg6 Jul 15, 2025
7ae713a
GH-605: test passing after refactoring
utkarshg6 Jul 15, 2025
e6e3968
GH-605: bit more refactoring
utkarshg6 Jul 15, 2025
9ac296e
GH-605: some more; test still passing
utkarshg6 Jul 15, 2025
e36cf67
GH-605: the left side of the finish scan is working properly
utkarshg6 Jul 16, 2025
4483879
GH-605: payable_scanner_is_facing_failed_transactions_and_their_finge…
utkarshg6 Jul 17, 2025
85a6b36
GH-605: 2 panics are being tested
utkarshg6 Jul 19, 2025
4970ec7
GH-605: add test payable_scanner_panics_after_migration_when_not_all_…
utkarshg6 Jul 19, 2025
9b76297
GH-605: one more test is fixed
utkarshg6 Jul 19, 2025
51357e9
GH-605: add TODOs after discussion
utkarshg6 Jul 20, 2025
7e4bf29
Merge branch 'GH-598' into GH-605
utkarshg6 Jul 21, 2025
7f4582f
GH-605: introduce separate_batch_results() function
utkarshg6 Jul 22, 2025
a9ba9d6
GH-605: more changes to finish_scan()
utkarshg6 Jul 22, 2025
ffe3a95
GH-605: compiling after further modifications
utkarshg6 Jul 22, 2025
97dd8ee
GH-605: migration and refactoring
utkarshg6 Jul 22, 2025
d806b08
GH-605: eliminate unnecessary code
utkarshg6 Jul 22, 2025
e9d5341
GH-605: Two tests passing
utkarshg6 Jul 22, 2025
2b73f65
GH-605: more tests passing
utkarshg6 Jul 22, 2025
fa01dc1
GH-605: some more code changes
utkarshg6 Jul 22, 2025
32cc13a
GH-605: few more changes
utkarshg6 Jul 22, 2025
0cfe08f
GH-605: more testing
utkarshg6 Jul 22, 2025
7eebffd
GH-605: remove unnecessary code
utkarshg6 Jul 22, 2025
dda0635
GH-605: properly test generate_failed_payables
utkarshg6 Jul 23, 2025
8f55ee2
GH-605: few more tests
utkarshg6 Jul 23, 2025
589dd5c
GH-605: write tests for handle_local_error
utkarshg6 Jul 24, 2025
7aa4951
GH-605: tests for handle_batch_results
utkarshg6 Jul 24, 2025
3f7df14
GH-605: test panicking cases for handle_batch_results
utkarshg6 Jul 24, 2025
5e9ab2e
GH-605: add more tests for process_result()
utkarshg6 Jul 24, 2025
b3203ac
GH-605: introduce the outcome in subsidiary fns
utkarshg6 Jul 24, 2025
fea14ee
GH-605: remove unnecessary code from the payable_scanner
utkarshg6 Jul 24, 2025
19790c9
GH-605: fix test utility issue which was causing a lot of tests to fail
utkarshg6 Jul 24, 2025
05796b1
GH-605: further refactoring and fixes
utkarshg6 Jul 24, 2025
f111d2a
GH-605: remove more unnecessary code
utkarshg6 Jul 24, 2025
f5b1a85
GH-605: bit more cleanup
utkarshg6 Jul 24, 2025
4fddf06
GH-605: add one more test for the flag
utkarshg6 Jul 24, 2025
e48ad5f
GH-605: new_calls_factories_properly is working again
utkarshg6 Jul 24, 2025
80a13e8
GH-605: fixed few more tests
utkarshg6 Jul 24, 2025
7d4cfb4
GH-605: some minor changes
utkarshg6 Jul 25, 2025
c2ce79c
Merge branch 'GH-598' into GH-605
utkarshg6 Jul 25, 2025
a964eb4
GH-605: code modularization
utkarshg6 Jul 25, 2025
0fd09d0
GH-605: add ability to call the start_scan from the tests
utkarshg6 Jul 25, 2025
1bb1bf7
GH-605: add code for start_scan_for_retry_works
utkarshg6 Jul 25, 2025
e73c1f7
GH-605: all lines are tested
utkarshg6 Jul 25, 2025
c567ec3
GH-605: add more functionality to the test
utkarshg6 Jul 25, 2025
8cd763b
GH-605: introduce retrieve condition for PayableDao
utkarshg6 Jul 27, 2025
0727713
GH-605: ability to retrieve non pending payables by addresses
utkarshg6 Jul 27, 2025
6306d65
GH-605: add ability for start_scan() to fetch payables
utkarshg6 Jul 27, 2025
e9f870c
GH-605: the new payables are being generated
utkarshg6 Jul 27, 2025
fac4059
GH-605: add the case when transaction is being retried but no payable…
utkarshg6 Jul 27, 2025
274c060
GH-605: another refactor
utkarshg6 Jul 27, 2025
61c709c
GH-605: more refactoring
utkarshg6 Jul 27, 2025
ea399b0
GH-605: few renames
utkarshg6 Jul 27, 2025
26d704d
GH-605: further simplification of the code
utkarshg6 Jul 27, 2025
a109005
GH-605: cleanup in start_scan()
utkarshg6 Jul 28, 2025
6f9638b
GH-605: add assertions for mocks
utkarshg6 Jul 28, 2025
e61a064
GH-605: use hashmap instead of vector
utkarshg6 Jul 28, 2025
8d66f76
GH-605: base for TxTemplate
utkarshg6 Jul 28, 2025
a621374
GH-605: it has started to compile
utkarshg6 Jul 29, 2025
dff5548
GH-605: it has started to compile again
utkarshg6 Jul 29, 2025
9fc8280
GH-605: it has started to compile again and again
utkarshg6 Jul 29, 2025
4ef6ee6
GH-605: migrate structures to the data_structures.rs file
utkarshg6 Jul 29, 2025
3247696
GH-605: add more functionality to the data structure file
utkarshg6 Jul 29, 2025
dc4f867
GH-605: introduce NewTxTemplates and RetryTxTemplates
utkarshg6 Jul 29, 2025
0d81aad
GH-605: use Either in price_qualified_payables
utkarshg6 Jul 30, 2025
4603a76
GH-605: compiling again
utkarshg6 Jul 30, 2025
7996a66
GH-605: returns_correct_priced_qualified_payables_for_retry_payable_s…
utkarshg6 Jul 30, 2025
fa7c5cd
GH-605: one more minor change
utkarshg6 Jul 30, 2025
2e86b7b
GH-605: some more changes
utkarshg6 Jul 30, 2025
b9f7ede
GH-605: tests are working fine for new tx templates
utkarshg6 Jul 30, 2025
7427d7c
GH-605: log improvements is wip
utkarshg6 Jul 30, 2025
a5dfd58
GH-605: able to log for retry payables in a single go
utkarshg6 Jul 30, 2025
f0b29f3
GH-605: two more test start to pass
utkarshg6 Jul 30, 2025
e86beb6
GH-605: all tests pass in agent_web3.rs
utkarshg6 Jul 30, 2025
41d8c98
GH-605: add stronger assertions to agent_web3.rs
utkarshg6 Jul 30, 2025
bbf692d
GH-605: add the TODO
utkarshg6 Jul 31, 2025
6f7469d
GH-605: all tests pass in blockchain_interface_web3/mod.rs
utkarshg6 Jul 31, 2025
7035d80
GH-605: modularize NewTxTemplates and RetryTxTemplates
utkarshg6 Jul 31, 2025
ba21894
GH-605: add ability to iterate over the NewTxTemplates and RetryTxTem…
utkarshg6 Jul 31, 2025
87f564d
GH-605: pre cleanup
utkarshg6 Jul 31, 2025
42ac352
GH-605: tests passing in agent and blockchain interface
utkarshg6 Jul 31, 2025
f8e52d8
GH-605: bit more refactoring
utkarshg6 Jul 31, 2025
2c68eb1
GH-605: compiling again
utkarshg6 Aug 1, 2025
037f261
GH-605: introduce signable_tx_template
utkarshg6 Aug 1, 2025
c768bc2
GH-605: it's compilig again
utkarshg6 Aug 1, 2025
ef3d0b5
GH-605: SignableTxTemplates can be created from PricedTxTemplates
utkarshg6 Aug 1, 2025
3137279
GH-605: add test for creating signable tx templates from priced retry…
utkarshg6 Aug 1, 2025
d4877c8
GH-645: from_priced_retry_tx_templates starts to work
utkarshg6 Aug 3, 2025
3805c0a
GH-645: a better algorithm using vectors
utkarshg6 Aug 3, 2025
5c4a4f1
GH-605: add test for largest amount and more cleanup
utkarshg6 Aug 3, 2025
2afc136
GH-605: more ordering
utkarshg6 Aug 3, 2025
d17ebd9
GH-605: implement nonce_range method
utkarshg6 Aug 3, 2025
58f1b56
GH-605: introduce make_signable_tx_template
utkarshg6 Aug 3, 2025
475c1c8
GH-605: better logging for tx signing:
utkarshg6 Aug 3, 2025
69e028f
GH-605: remove clone on consuming wallet
utkarshg6 Aug 3, 2025
2c315d8
GH-605: improve logic of logging tx
utkarshg6 Aug 3, 2025
97a783c
GH-605: exp: return Tx instead of HashAndAmount in Futures
utkarshg6 Aug 3, 2025
133e146
GH-605: exp: replace Vec<IndividualBatchResult> to BatchResults
utkarshg6 Aug 3, 2025
348d864
GH-605: exp: payment_procedure_result is a result now
utkarshg6 Aug 3, 2025
878b868
GH-605: exp: Sending Error now holds all FailedTx
utkarshg6 Aug 3, 2025
f54582b
GH-605: exp: sending error is now being returned
utkarshg6 Aug 3, 2025
145230b
GH-605: exp: one test fixed in utils.rs
utkarshg6 Aug 3, 2025
7536e62
GH-605: exp: sending error is received up to the end
utkarshg6 Aug 3, 2025
2175e70
GH-605: exp: new_payable_scan_finishes_as_expected works
utkarshg6 Aug 4, 2025
95ea5aa
GH-605: exp: minor refactoring
utkarshg6 Aug 4, 2025
fe41ce1
GH-605: exp: the errors are properly handled
utkarshg6 Aug 4, 2025
9f82e14
GH-605: exp: ability to retrieve txs by receiver addresess
utkarshg6 Aug 4, 2025
58fd61f
GH-605: add ability to update after retries
utkarshg6 Aug 4, 2025
053f17c
GH-605: comment old code in Payable Scanner
utkarshg6 Aug 4, 2025
bc1da9b
GH-605: remove a lot of code from the Payable Scanner's finish scan o…
utkarshg6 Aug 4, 2025
04253f0
GH-605: fix one more test
utkarshg6 Aug 4, 2025
c27d280
GH-605: retry_payable_scanner_can_initiate_a_scan works
utkarshg6 Aug 5, 2025
eed71a5
GH-605: remove the test that was panicking in case no qualified payab…
utkarshg6 Aug 5, 2025
bad735a
GH-605: eliminate warnings
utkarshg6 Aug 5, 2025
761b9ca
GH-605: accountant_processes_sent_payables_and_schedules_pending_paya…
utkarshg6 Aug 5, 2025
f78c942
GH-605: sent_payable_with_response_skeleton_sends_scan_response_to_ui…
utkarshg6 Aug 5, 2025
1376a9d
GH-605: qualified_payables_under_our_money_limit_are_forwarded_to_blo…
utkarshg6 Aug 5, 2025
778b5bc
GH-605: periodical_scanning_for_payables_works
utkarshg6 Aug 5, 2025
5c8e5a9
GH-605: accountant_scans_after_startup_and_detects_pending_payable_fr…
utkarshg6 Aug 5, 2025
cf53cac
GH-605: send_payables_within_batch_fails_on_submit_batch_call works
utkarshg6 Aug 5, 2025
12618d7
GH-605: blockchain/blockchain_interface/blockchain_interface_web3/uti…
utkarshg6 Aug 5, 2025
44ac46a
GH-605: send_payables_within_batch_one_payment_works_the_other_fails …
utkarshg6 Aug 5, 2025
0e09940
GH-605: all tests pass in blockchain_interface_web3/utils.rs
utkarshg6 Aug 5, 2025
d6edeea
GH-605: minor refactor in utils.rs
utkarshg6 Aug 5, 2025
d1299c6
GH-605: process_payments_works
utkarshg6 Aug 5, 2025
b11db25
GH-605: all tests pass in blockchain_bridge.rs
utkarshg6 Aug 5, 2025
e544c06
GH-605: remove unnecessary code
utkarshg6 Aug 6, 2025
0fb693b
GH-605: fixed todo!() in scanners/mod.rs
utkarshg6 Aug 6, 2025
3e9a954
GH-605: fixed another todo!() in accountant/mod.rs
utkarshg6 Aug 6, 2025
e3618ee
GH-605: eliminated last todo!()
utkarshg6 Aug 6, 2025
1d779a3
Merge branch 'GH-598' into GH-605
utkarshg6 Aug 6, 2025
d67b33a
GH-605: only tests related to PendingPayableScan are failing in Accou…
utkarshg6 Aug 6, 2025
f6866ec
GH-605: migrate payable_scanner extension to payable_scanner
utkarshg6 Aug 6, 2025
3e0faee
GH-605: cleanup in payable_scanner_extension
utkarshg6 Aug 6, 2025
8ac33b5
GH-605: more cleanup
utkarshg6 Aug 6, 2025
3d44055
GH-605: migrate BlockchainAgentMock test utils
utkarshg6 Aug 6, 2025
a4f1d56
GH-605: eliminate the test utils file from Payable Scanner Extension
utkarshg6 Aug 6, 2025
f8c5308
GH-605: migrate core functionality of extension to payable scanner
utkarshg6 Aug 6, 2025
ed8b963
GH-605: payable_scanner_extension is history
utkarshg6 Aug 6, 2025
7ba5e31
GH-605: remove computed_gas_price from the RetryTxTemplate
utkarshg6 Aug 6, 2025
efb285b
GH-605: refactor in test_utils
utkarshg6 Aug 6, 2025
0dba0d6
GH-605: mark successfully retried txs as concluded
utkarshg6 Aug 6, 2025
fe3af5e
GH-605: minor renaming
utkarshg6 Aug 6, 2025
5d7302a
GH-605: add a TODO
utkarshg6 Aug 6, 2025
3c831ec
GH-605: minor log change
utkarshg6 Aug 6, 2025
3658464
GH-605: OperationOutcome now provides which scanner to run
utkarshg6 Aug 6, 2025
d69bc22
GH-605: use BTreeSet instead of HashSet
utkarshg6 Aug 7, 2025
11e2927
GH-605: sent payables uses BTreeset
utkarshg6 Aug 7, 2025
f7afc76
GH-605: failed payables also uses BTreeset everywhere
utkarshg6 Aug 7, 2025
852cd8f
GH-605: implement Ordering for FailedPayables
utkarshg6 Aug 7, 2025
de0eca0
GH-605: implement Ordering for SentPayables
utkarshg6 Aug 7, 2025
a15468f
GH-605: fix one more test
utkarshg6 Aug 11, 2025
666755b
GH-605: cleanup and code migration
utkarshg6 Aug 11, 2025
920bf31
GH-605: another refactor
utkarshg6 Aug 11, 2025
272d2d1
GH-605: more refactoring
utkarshg6 Aug 12, 2025
f6bb58a
GH-605: more refactoring
utkarshg6 Aug 12, 2025
dae6750
GH-605: minor rename
utkarshg6 Aug 12, 2025
efa59f3
GH-605: more renaming
utkarshg6 Aug 12, 2025
385777e
GH-605: add crate-level attribute to test files
utkarshg6 Aug 13, 2025
08ce789
GH-605: test empty vectors in fn arguments
utkarshg6 Aug 14, 2025
a641b5f
GH-605: more changes in payable_scanner/mod.rs
utkarshg6 Aug 15, 2025
aeac1de
GH-605: more cleanup in the start_scan
utkarshg6 Aug 15, 2025
860cb49
GH-605: introduce trait Transaction
utkarshg6 Aug 15, 2025
bbf271d
GH-605: write tests for empty vectors in batch results
utkarshg6 Aug 16, 2025
29a0d66
GH-605: mark logs with failed txs as WARN
utkarshg6 Aug 16, 2025
88998a7
GH-605: panics are tested better
utkarshg6 Aug 16, 2025
773ca7d
GH-605: rename non_pending_payables
utkarshg6 Aug 16, 2025
68f6e99
GH-605: use references on SentPayables wherever possible
utkarshg6 Aug 16, 2025
0721c30
GH-605: migrate payment adjuster code to a new file
utkarshg6 Aug 16, 2025
5b948a7
GH-605: add log while handling initial templates msg
utkarshg6 Aug 16, 2025
567d335
GH-605: mark_prev_txs_as_concluded_updates_statuses_correctly is prop…
utkarshg6 Aug 17, 2025
97511ea
GH-605: improve update_statuses_of_prev_txs
utkarshg6 Aug 17, 2025
02fb7e0
Merge branch 'GH-598' into GH-605-pre-review
utkarshg6 Aug 22, 2025
6d4df87
GH-605: add test for iterator
utkarshg6 Aug 22, 2025
ba5fa0d
GH-605: fix more tests
utkarshg6 Aug 22, 2025
6402474
GH-605: remove all TODOs
utkarshg6 Aug 22, 2025
d10dcc9
GH-605: add copuright lines at the top of the files
utkarshg6 Aug 22, 2025
f7e2bb0
GH-605: rename OperationOutcome to NextScanToRun
utkarshg6 Aug 22, 2025
6d3ed4d
GH-605: more fixes with renames
utkarshg6 Aug 22, 2025
7b16efd
GH-605: schedule next scan is well tested
utkarshg6 Aug 24, 2025
928d136
GH-605: pre review changes
utkarshg6 Aug 24, 2025
093d7de
GH-605: review changes
utkarshg6 Sep 6, 2025
2fd4bcc
GH-605: eliminate new_fingerprints_recipient
utkarshg6 Sep 11, 2025
44be81d
GH-605: add commit hash to TODO
utkarshg6 Sep 11, 2025
cc7da7a
GH-605: add TODOs for GH-703
utkarshg6 Sep 11, 2025
d666e53
GH-605: refactor out the failed_tx
utkarshg6 Sep 11, 2025
2450508
GH-605: more review changes
utkarshg6 Sep 11, 2025
bb1a67d
GH-605: more refactoring of sql values
utkarshg6 Sep 11, 2025
074a40b
GH-605: further fixes
utkarshg6 Sep 11, 2025
070123a
GH-605: more changes
utkarshg6 Sep 11, 2025
52034fb
GH-605: change it to retrieved_payables
utkarshg6 Sep 12, 2025
8f63153
GH-605: rename to determine_next_scan_to_run
utkarshg6 Sep 12, 2025
1c2d773
GH-605: more changes
utkarshg6 Sep 12, 2025
e851f34
GH-605: improve the TODO
utkarshg6 Sep 12, 2025
24396b1
GH-605: add TODO for the test
utkarshg6 Sep 16, 2025
d2fd9cd
GH-605: more and more changes
utkarshg6 Sep 18, 2025
52411c9
GH-605: bit more refactoring
utkarshg6 Sep 18, 2025
398bdd9
GH-605: bit more changes
utkarshg6 Sep 18, 2025
e044dc4
GH-605: changing to & works
utkarshg6 Sep 18, 2025
8227dc8
GH-605: further changes
utkarshg6 Sep 18, 2025
ff6e400
GH-605: more TODOs
utkarshg6 Sep 18, 2025
dc863ef
GH-605: derive Copy for PayableScanType
utkarshg6 Sep 19, 2025
9fd9ee7
GH-605: add scan_type function
utkarshg6 Sep 19, 2025
9ba398e
GH-605: comment out unused code in test
utkarshg6 Sep 19, 2025
80711d4
GH-605: refactor the code a bit
utkarshg6 Sep 19, 2025
4ac6418
GH-605: refactor signable_tx_templates_can_be_created_from_priced_ret…
utkarshg6 Sep 19, 2025
83d6155
GH-605: the helper functions have more realistic args name
utkarshg6 Sep 19, 2025
141d10a
GH-605: more refactoring of signable_tx_templates_can_be_created_from…
utkarshg6 Sep 19, 2025
4f91045
GH-605: more refactored changes
utkarshg6 Sep 19, 2025
896f7d0
GH-605: further refactoring changes
utkarshg6 Sep 19, 2025
18e0a54
GH-605: handle_batch_results has been renamed
utkarshg6 Sep 19, 2025
cf0938a
GH-605: few more changes
utkarshg6 Sep 20, 2025
9308d37
GH-605: few more changes
utkarshg6 Sep 20, 2025
73395d8
GH-605: Review 4
utkarshg6 Sep 22, 2025
7522708
GH-605: Bug bot error
utkarshg6 Sep 22, 2025
e7c7716
GH-605: Just merged; 567 errors
utkarshg6 Sep 23, 2025
794d23a
GH-605: reduced errors to 97
utkarshg6 Sep 24, 2025
655830d
GH-605: only 37 errors remaining
utkarshg6 Sep 24, 2025
06106f7
GH-605: only 5 errors remaining
utkarshg6 Sep 25, 2025
8947136
GH-605: only 2 errors remaining
utkarshg6 Sep 25, 2025
b2df759
GH-605: all errors gone
utkarshg6 Sep 25, 2025
2828f80
GH-605: tests in sent_payable_dao are passing
utkarshg6 Sep 25, 2025
9a51af4
GH-605: all tests pass in payable scanner
utkarshg6 Sep 26, 2025
663c30e
GH-605: fix most of the clippy warnings
utkarshg6 Sep 26, 2025
6c84f82
GH-605: fix more of these problems
utkarshg6 Sep 26, 2025
2f07581
GH-605: write test for the ordering of ValidationStatus
utkarshg6 Sep 26, 2025
d6b8592
GH-605: implement ordering for ValidationStatus
utkarshg6 Sep 26, 2025
5838a52
GH-605: comment out unused code
utkarshg6 Sep 26, 2025
eab920d
GH-605: more changes fixed
utkarshg6 Sep 26, 2025
2cbdffe
GH-605: more fixing
utkarshg6 Sep 26, 2025
62f3542
GH-605: interim commit
Sep 26, 2025
97f54c8
GH-605: all tests in Node passing
Sep 27, 2025
d94d5cb
GH-605: last todo removed
Sep 28, 2025
b82e3d2
GH-605: fixed poor test coverage
Sep 28, 2025
76a857c
GH-605: free of unnecessary boilerplate code - erased manual impls fo…
Sep 28, 2025
b9ad935
GH-605: continuous impovement -- Ord and little refactoring
Sep 29, 2025
00f0223
GH-605: CI except MNT just fine
Sep 29, 2025
15a4de1
GH-605: MNT fixed
Sep 29, 2025
02d98fb
GH-605: small correction
Sep 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions masq_lib/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,30 @@ macro_rules! hashset {
};
}

#[macro_export(local_inner_macros)]
macro_rules! btreeset {
() => {
::std::collections::BTreeSet::new()
};
($($val:expr,)+) => {
btreeset!($($val),+)
};
($($value:expr),+) => {
{
let mut _bts = ::std::collections::BTreeSet::new();
$(
let _ = _bts.insert($value);
)*
_bts
}
};
}

#[cfg(test)]
mod tests {
use super::*;
use itertools::Itertools;
use std::collections::BTreeSet;
use std::collections::{BTreeMap, HashMap, HashSet};
use std::env::current_dir;
use std::fmt::Write;
Expand Down Expand Up @@ -956,4 +976,45 @@ mod tests {
assert_eq!(hashset_of_string, expected_hashset_of_string);
assert_eq!(hashset_with_duplicate, expected_hashset_with_duplicate);
}

#[test]
fn btreeset_macro_works() {
let empty_btreeset: BTreeSet<i32> = btreeset!();
let btreeset_with_one_element = btreeset!(2);
let btreeset_with_multiple_elements = btreeset!(2, 20, 42);
let btreeset_with_trailing_comma = btreeset!(2, 20,);
let btreeset_of_string = btreeset!("val_a", "val_b");
let btreeset_with_duplicate = btreeset!(2, 2);

let expected_empty_btreeset: BTreeSet<i32> = BTreeSet::new();
let mut expected_btreeset_with_one_element = BTreeSet::new();
expected_btreeset_with_one_element.insert(2);
let mut expected_btreeset_with_multiple_elements = BTreeSet::new();
expected_btreeset_with_multiple_elements.insert(2);
expected_btreeset_with_multiple_elements.insert(20);
expected_btreeset_with_multiple_elements.insert(42);
let mut expected_btreeset_with_trailing_comma = BTreeSet::new();
expected_btreeset_with_trailing_comma.insert(2);
expected_btreeset_with_trailing_comma.insert(20);
let mut expected_btreeset_of_string = BTreeSet::new();
expected_btreeset_of_string.insert("val_a");
expected_btreeset_of_string.insert("val_b");
let mut expected_btreeset_with_duplicate = BTreeSet::new();
expected_btreeset_with_duplicate.insert(2);
assert_eq!(empty_btreeset, expected_empty_btreeset);
assert_eq!(
btreeset_with_one_element,
expected_btreeset_with_one_element
);
assert_eq!(
btreeset_with_multiple_elements,
expected_btreeset_with_multiple_elements
);
assert_eq!(
btreeset_with_trailing_comma,
expected_btreeset_with_trailing_comma
);
assert_eq!(btreeset_of_string, expected_btreeset_of_string);
assert_eq!(btreeset_with_duplicate, expected_btreeset_with_duplicate);
}
}
6 changes: 3 additions & 3 deletions multinode_integration_tests/tests/bookkeeping_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn provided_and_consumed_services_are_recorded_in_databases() {
);

// get all payables from originating node
let payables = non_pending_payables(&originating_node);
let payables = retrieve_payables(&originating_node);

// Waiting until the serving nodes have finished accruing their receivables
thread::sleep(Duration::from_secs(10));
Expand Down Expand Up @@ -79,9 +79,9 @@ fn provided_and_consumed_services_are_recorded_in_databases() {
});
}

fn non_pending_payables(node: &MASQRealNode) -> Vec<PayableAccount> {
fn retrieve_payables(node: &MASQRealNode) -> Vec<PayableAccount> {
let payable_dao = payable_dao(node.name());
payable_dao.non_pending_payables()
payable_dao.retrieve_payables(None)
}

fn receivables(node: &MASQRealNode) -> Vec<ReceivableAccount> {
Expand Down
6 changes: 3 additions & 3 deletions multinode_integration_tests/tests/verify_bill_payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ fn verify_bill_payment() {
}

let now = Instant::now();
while !consuming_payable_dao.non_pending_payables().is_empty()
while !consuming_payable_dao.retrieve_payables(None).is_empty()
&& now.elapsed() < Duration::from_secs(10)
{
thread::sleep(Duration::from_millis(400));
Expand Down Expand Up @@ -400,7 +400,7 @@ fn verify_pending_payables() {
);

let now = Instant::now();
while !consuming_payable_dao.non_pending_payables().is_empty()
while !consuming_payable_dao.retrieve_payables(None).is_empty()
&& now.elapsed() < Duration::from_secs(10)
{
thread::sleep(Duration::from_millis(400));
Expand Down Expand Up @@ -437,7 +437,7 @@ fn verify_pending_payables() {
.tmb(0),
);

assert!(consuming_payable_dao.non_pending_payables().is_empty());
assert!(consuming_payable_dao.retrieve_payables(None).is_empty());
MASQNodeUtils::assert_node_wrote_log_containing(
real_consuming_node.name(),
"Found 3 pending payables to process",
Expand Down
Loading