Skip to content
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

Remove block index arg from manual account sync test util #255

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions full-service/src/db/transaction_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,6 @@ mod tests {
&ledger_db,
&wallet_db,
&AccountID(tx_log.account_id_hex.to_string()),
14,
&logger,
);

Expand Down Expand Up @@ -1190,7 +1189,6 @@ mod tests {
&ledger_db,
&wallet_db,
&AccountID(tx_log.account_id_hex.to_string()),
15,
&logger,
);

Expand Down
15 changes: 6 additions & 9 deletions full-service/src/db/txo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ mod tests {
assert_eq!(ledger_db.num_blocks().unwrap(), 13);

let _alice_account =
manually_sync_account(&ledger_db, &wallet_db, &alice_account_id, 13, &logger);
manually_sync_account(&ledger_db, &wallet_db, &alice_account_id, &logger);

let txos = Txo::list_for_account(
&alice_account_id.to_string(),
Expand Down Expand Up @@ -1058,9 +1058,7 @@ mod tests {

// Now we'll process these Txos and verify that the TXO was "spent."
let _alice_account =
manually_sync_account(&ledger_db, &wallet_db, &alice_account_id, 14, &logger);

manually_sync_account(&ledger_db, &wallet_db, &alice_account_id, 14, &logger);
manually_sync_account(&ledger_db, &wallet_db, &alice_account_id, &logger);

// We should now have 3 txos for this account - one spent, one change (minted),
// and one minted (destined for alice).
Expand Down Expand Up @@ -1227,11 +1225,10 @@ mod tests {
);

// Process the latest block for Bob (note, Bob is starting to sync from block 0)
let _bob_account =
manually_sync_account(&ledger_db, &wallet_db, &bob_account_id, 15, &logger);
let _bob_account = manually_sync_account(&ledger_db, &wallet_db, &bob_account_id, &logger);
// Process the latest block for Alice
let _alice_account =
manually_sync_account(&ledger_db, &wallet_db, &alice_account_id, 15, &logger);
manually_sync_account(&ledger_db, &wallet_db, &alice_account_id, &logger);

// We should now have 1 txo in Bob's account.
let txos = Txo::list_for_account(
Expand Down Expand Up @@ -1554,8 +1551,8 @@ mod tests {

// Now let our sync thread catch up for both sender and receiver
log::info!(logger, "Manually syncing account");
manually_sync_account(&ledger_db, &wallet_db, &recipient_account_id, 16, &logger);
manually_sync_account(&ledger_db, &wallet_db, &sender_account_id, 16, &logger);
manually_sync_account(&ledger_db, &wallet_db, &recipient_account_id, &logger);
manually_sync_account(&ledger_db, &wallet_db, &sender_account_id, &logger);

// Then let's make sure we received the Txo on the recipient account
log::info!(logger, "Listing all Txos for recipient account");
Expand Down
39 changes: 0 additions & 39 deletions full-service/src/json_rpc/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
13,
&logger,
);

Expand Down Expand Up @@ -593,7 +592,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
13,
&logger,
);

Expand Down Expand Up @@ -656,7 +654,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
13,
&logger,
);
assert_eq!(ledger_db.num_blocks().unwrap(), 13);
Expand All @@ -674,7 +671,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
14,
&logger,
);
assert_eq!(ledger_db.num_blocks().unwrap(), 14);
Expand Down Expand Up @@ -749,7 +745,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
15,
&logger,
);
assert_eq!(ledger_db.num_blocks().unwrap(), 15);
Expand Down Expand Up @@ -830,7 +825,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
13,
&logger,
);
assert_eq!(ledger_db.num_blocks().unwrap(), 13);
Expand Down Expand Up @@ -879,7 +873,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
14,
&logger,
);
assert_eq!(ledger_db.num_blocks().unwrap(), 14);
Expand Down Expand Up @@ -997,7 +990,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
15,
&logger,
);
assert_eq!(ledger_db.num_blocks().unwrap(), 15);
Expand Down Expand Up @@ -1203,7 +1195,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
13,
&logger,
);
assert_eq!(ledger_db.num_blocks().unwrap(), 13);
Expand All @@ -1221,7 +1212,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
14,
&logger,
);
assert_eq!(ledger_db.num_blocks().unwrap(), 14);
Expand Down Expand Up @@ -1259,7 +1249,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
15,
&logger,
);

Expand Down Expand Up @@ -1310,7 +1299,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
17,
&logger,
);

Expand Down Expand Up @@ -1422,7 +1410,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(alice_account_id.to_string()),
13,
&logger,
);

Expand Down Expand Up @@ -1568,21 +1555,18 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(alice_account_id.to_string()),
14,
&logger,
);
manually_sync_account(
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(bob_account_id.to_string()),
14,
&logger,
);
manually_sync_account(
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(charlie_account_id.to_string()),
14,
&logger,
);

Expand Down Expand Up @@ -1745,7 +1729,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
22,
&logger,
);

Expand Down Expand Up @@ -1933,7 +1916,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
13,
&logger,
);
assert_eq!(ledger_db.num_blocks().unwrap(), 13);
Expand Down Expand Up @@ -1978,7 +1960,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
13,
&logger,
);
let body = json!({
Expand Down Expand Up @@ -2055,7 +2036,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
13,
&logger,
);

Expand Down Expand Up @@ -2151,7 +2131,6 @@ mod e2e {
&ledger_db,
&wallet_db,
&AccountID(account_id_1.to_string()),
13,
&logger,
);
assert_eq!(
Expand Down Expand Up @@ -2201,7 +2180,6 @@ mod e2e {
&ledger_db,
&wallet_db,
&AccountID(account_id_2.to_string()),
14,
&logger,
);
assert_eq!(
Expand Down Expand Up @@ -2271,7 +2249,6 @@ mod e2e {
&ledger_db,
&wallet_db,
&AccountID(account_id_3.to_string()),
15,
&logger,
);
assert_eq!(
Expand Down Expand Up @@ -2356,7 +2333,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
13,
&logger,
);

Expand Down Expand Up @@ -2532,7 +2508,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
13,
&logger,
);

Expand Down Expand Up @@ -2624,7 +2599,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
14,
&logger,
);

Expand Down Expand Up @@ -2710,7 +2684,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
14,
&logger,
);

Expand Down Expand Up @@ -2747,7 +2720,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
14,
&logger,
);

Expand Down Expand Up @@ -2859,7 +2831,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
15,
&logger,
);

Expand Down Expand Up @@ -2911,7 +2882,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
15,
&logger,
);

Expand Down Expand Up @@ -2967,7 +2937,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
13,
&logger,
);

Expand Down Expand Up @@ -3057,7 +3026,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
13,
&logger,
);

Expand Down Expand Up @@ -3151,7 +3119,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(account_id.to_string()),
14,
&logger,
);

Expand Down Expand Up @@ -3205,7 +3172,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(alice_account_id.to_string()),
13,
&logger,
);

Expand Down Expand Up @@ -3286,14 +3252,12 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(alice_account_id.to_string()),
14,
&logger,
);
manually_sync_account(
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(bob_account_id.to_string()),
14,
&logger,
);

Expand Down Expand Up @@ -3347,7 +3311,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(alice_account_id.to_string()),
13,
&logger,
);
// Create a gift code
Expand Down Expand Up @@ -3407,7 +3370,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(alice_account_id.to_string()),
14,
&logger,
);

Expand Down Expand Up @@ -3444,7 +3406,6 @@ mod e2e {
&ledger_db,
&db_ctx.get_db_instance(logger.clone()),
&AccountID(bob_account_id.to_string()),
14,
&logger,
);

Expand Down
1 change: 0 additions & 1 deletion full-service/src/service/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ mod tests {
&ledger_db,
&service.wallet_db,
&AccountID(account.account_id_hex.to_string()),
12,
&logger,
);

Expand Down
Loading