Skip to content

Commit

Permalink
Merge pull request #1443 from AloeareV/multistep_proposals
Browse files Browse the repository at this point in the history
Multistep proposals
  • Loading branch information
zancas authored Oct 18, 2024
2 parents 913c16c + cec234a commit d73f401
Show file tree
Hide file tree
Showing 34 changed files with 961 additions and 472 deletions.
76 changes: 23 additions & 53 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions darkside-tests/proptest-regressions/chain_generics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
# everyone who runs the test benefits from these saved cases.
cc eef3deec08ec4d278ea80acf3351dba273deacb3d9544ebf173c6ce8d5d3f79d # shrinks to value = 0
cc 58a549bf09db2b84ee36488c0bda1295ca5068fa7ec753dae3ca0b955bedd613 # shrinks to value = 0
cc e2b75ab014d34f914e99dd8b15e75371a3da8e4d14896d8d65dc7199990de081 # shrinks to value = 34
38 changes: 17 additions & 21 deletions darkside-tests/tests/advanced_reorg_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ use darkside_tests::{

use tokio::time::sleep;
use zcash_primitives::consensus::BlockHeight;
use zingolib::config::RegtestNetwork;
use zingolib::lightclient::PoolBalances;
use zingolib::testutils::{
lightclient::from_inputs, paths::get_cargo_manifest_dir, scenarios::setup::ClientBuilder,
};
use zingolib::wallet::data::summaries::ValueTransferKind;
use zingolib::{config::RegtestNetwork, wallet::data::summaries::SentValueTransfer};

#[ignore]
#[tokio::test]
Expand Down Expand Up @@ -605,7 +605,7 @@ async fn reorg_changes_outgoing_tx_height() {
.await
.iter()
.find_map(|v| match v.kind() {
ValueTransferKind::Sent => {
ValueTransferKind::Sent(SentValueTransfer::Send) => {
if let Some(addr) = v.recipient_address() {
if addr == recipient_string && v.value() == 100_000 {
Some(v.blockheight())
Expand Down Expand Up @@ -831,29 +831,25 @@ async fn reorg_expires_outgoing_tx_height() {

println!("{:?}", light_client.value_transfers().await);

assert_eq!(
light_client
.value_transfers()
.await
.iter()
.find_map(|v| match v.kind() {
ValueTransferKind::Sent => {
if let Some(addr) = v.recipient_address() {
if addr == recipient_string && v.value() == 100_000 {
Some(v.blockheight())
} else {
None
}
let send_height = light_client
.value_transfers()
.await
.iter()
.find_map(|v| match v.kind() {
ValueTransferKind::Sent(SentValueTransfer::Send) => {
if let Some(addr) = v.recipient_address() {
if addr == recipient_string && v.value() == 100_000 {
Some(v.blockheight())
} else {
None
}
}
_ => {
} else {
None
}
}),
Some(BlockHeight::from(sent_tx_height as u32))
);
}
_ => None,
});
assert_eq!(send_height, Some(BlockHeight::from(sent_tx_height as u32)));

//
// Create reorg
Expand Down Expand Up @@ -1024,7 +1020,7 @@ async fn reorg_changes_outgoing_tx_index() {
.await
.iter()
.find_map(|v| match v.kind() {
ValueTransferKind::Sent => {
ValueTransferKind::Sent(SentValueTransfer::Send) => {
if let Some(addr) = v.recipient_address() {
if addr == recipient_string && v.value() == 100_000 {
Some(v.blockheight())
Expand Down
4 changes: 3 additions & 1 deletion libtonode-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ bip0039.workspace = true
zcash_primitives = { workspace = true }
orchard = { workspace = true }
sapling-crypto = { workspace = true }
zcash_address = { workspace = true }
zcash_address = { workspace = true, features = ["test-dependencies"] }
zcash_client_backend = { workspace = true }
shardtree = { workspace = true }

Expand All @@ -31,3 +31,5 @@ serde_json = { workspace = true }
http.workspace = true
tempfile.workspace = true
tracing-subscriber.workspace = true
proptest.workspace = true
bech32 = "0.11.0"
Loading

0 comments on commit d73f401

Please sign in to comment.