Skip to content

Commit

Permalink
Merge pull request #78 from Oscar-Pepper/remove_quick_send_helper
Browse files Browse the repository at this point in the history
removed quick send helper
  • Loading branch information
idky137 authored Oct 18, 2024
2 parents fbddf8c + 14262d2 commit 6093c45
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 26 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ license = "Apache-2.0"


[workspace.dependencies]
# Zingolabs
zingolib = { git = "https://github.com/zingolabs/zingolib.git", tag = "zaino_dep_002_091024_95e5b0d8f9d5ee0485c6141533da2f727aeafae2", features = ["zaino-test"] }

# Temporarily removed until dependency conflic can be resolved.
# NymSdk
# nym-sdk = { git = "https://github.com/nymtech/nym", branch = "master" }
Expand Down
1 change: 1 addition & 0 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ nym_poc = []

[dependencies]
zaino-testutils = { path = "../zaino-testutils" }
zingolib = { workspace = true }

# Miscellaneous Workspace
tokio = { workspace = true }
28 changes: 15 additions & 13 deletions integration-tests/tests/integrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
use std::sync::{atomic::AtomicBool, Arc};
use zaino_testutils::{
drop_test_manager,
zingo_lightclient::{get_address, quick_send, start_mempool_monitor},
zingo_lightclient::{get_address, start_mempool_monitor},
TestManager,
};

mod wallet_basic {
use zingolib::testutils::lightclient::from_inputs;

use super::*;

#[tokio::test]
Expand Down Expand Up @@ -41,7 +43,7 @@ mod wallet_basic {
test_manager.regtest_manager.generate_n_blocks(1).unwrap();
zingo_client.do_sync(false).await.unwrap();

quick_send(
from_inputs::quick_send(
&zingo_client,
vec![(&get_address(&zingo_client, "unified").await, 250_000, None)],
)
Expand Down Expand Up @@ -71,7 +73,7 @@ mod wallet_basic {

test_manager.regtest_manager.generate_n_blocks(1).unwrap();
zingo_client.do_sync(false).await.unwrap();
quick_send(
from_inputs::quick_send(
&zingo_client,
vec![(&get_address(&zingo_client, "sapling").await, 250_000, None)],
)
Expand Down Expand Up @@ -101,7 +103,7 @@ mod wallet_basic {

test_manager.regtest_manager.generate_n_blocks(1).unwrap();
zingo_client.do_sync(false).await.unwrap();
quick_send(
from_inputs::quick_send(
&zingo_client,
vec![(
&get_address(&zingo_client, "transparent").await,
Expand Down Expand Up @@ -135,19 +137,19 @@ mod wallet_basic {

test_manager.regtest_manager.generate_n_blocks(2).unwrap();
zingo_client.do_sync(false).await.unwrap();
quick_send(
from_inputs::quick_send(
&zingo_client,
vec![(&get_address(&zingo_client, "unified").await, 250_000, None)],
)
.await
.unwrap();
quick_send(
from_inputs::quick_send(
&zingo_client,
vec![(&get_address(&zingo_client, "sapling").await, 250_000, None)],
)
.await
.unwrap();
quick_send(
from_inputs::quick_send(
&zingo_client,
vec![(
&get_address(&zingo_client, "transparent").await,
Expand Down Expand Up @@ -183,7 +185,7 @@ mod wallet_basic {

test_manager.regtest_manager.generate_n_blocks(1).unwrap();
zingo_client.do_sync(false).await.unwrap();
quick_send(
from_inputs::quick_send(
&zingo_client,
vec![(
&get_address(&zingo_client, "transparent").await,
Expand Down Expand Up @@ -228,22 +230,22 @@ mod wallet_basic {
zingo_client.do_sync(false).await.unwrap();

test_manager.regtest_manager.generate_n_blocks(5).unwrap();
quick_send(
from_inputs::quick_send(
&zingo_client,
vec![(&get_address(&zingo_client, "unified").await, 250_000, None)],
)
.await
.unwrap();
test_manager.regtest_manager.generate_n_blocks(15).unwrap();
quick_send(
from_inputs::quick_send(
&zingo_client,
vec![(&get_address(&zingo_client, "sapling").await, 250_000, None)],
)
.await
.unwrap();

test_manager.regtest_manager.generate_n_blocks(15).unwrap();
quick_send(
from_inputs::quick_send(
&zingo_client,
vec![(
&get_address(&zingo_client, "transparent").await,
Expand Down Expand Up @@ -281,13 +283,13 @@ mod wallet_basic {

test_manager.regtest_manager.generate_n_blocks(1).unwrap();
zingo_client.do_sync(false).await.unwrap();
quick_send(
from_inputs::quick_send(
&zingo_client,
vec![(&get_address(&zingo_client, "sapling").await, 250_000, None)],
)
.await
.unwrap();
quick_send(
from_inputs::quick_send(
&zingo_client,
vec![(&get_address(&zingo_client, "sapling").await, 250_000, None)],
)
Expand Down
2 changes: 1 addition & 1 deletion zaino-testutils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ zaino-fetch = { path = "../zaino-fetch" }
zainod = { path = "../zainod" }

# ZingoLib
zingolib = { git = "https://github.com/zingolabs/zingolib.git", tag = "zaino_dep_002_091024_95e5b0d8f9d5ee0485c6141533da2f727aeafae2", features = ["zaino-test"] }
zingolib = { workspace = true }
# zingolib = { git = "https://github.com/idky137/zingolib.git", branch = "zaino_temp_dep", features = ["zaino-test"] }
# zingolib = { path = "../../zingolib/zingolib", features = ["zaino-test"] }

Expand Down
12 changes: 0 additions & 12 deletions zaino-testutils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,18 +286,6 @@ pub mod zingo_lightclient {
zingolib::get_base_address_macro!(zingo_client, pool)
}

/// Sends funds to address given, handles proposals internally.
///
/// recievers should be in the form vec![Address, Amount, Option<Memo>]
pub async fn quick_send(
zingo_client: &zingolib::lightclient::LightClient,
receivers: Vec<(&str, u64, Option<&str>)>,
) -> Result<String, zingolib::lightclient::send::send_with_proposal::QuickSendError> {
zingolib::testutils::lightclient::from_inputs::quick_send(zingo_client, receivers)
.await
.map(|tx_ids| tx_ids.into_iter().next().unwrap().to_string())
}

/// Starts Zingolib::lightclients's mempool monitor.
pub async fn start_mempool_monitor(zingo_client: &zingolib::lightclient::LightClient) {
let zingo_client_saved = zingo_client.export_save_buffer_async().await.unwrap();
Expand Down

0 comments on commit 6093c45

Please sign in to comment.