Skip to content

Commit bd9a552

Browse files
committed
Merge branch 'dev' into stable
2 parents 5e319f4 + 3045bea commit bd9a552

File tree

31 files changed

+345
-367
lines changed

31 files changed

+345
-367
lines changed

darkside-tests/tests/advanced_reorg_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ async fn reorg_changes_outgoing_tx_index() {
10481048
//
10491049

10501050
// stage empty blocks from height 205 to cause a Reorg
1051-
_ = connector.stage_blocks_create(sent_tx_height, 20, 1).await;
1051+
_ = connector.stage_blocks_create(sent_tx_height, 20, 102).await;
10521052

10531053
_ = connector
10541054
.stage_transactions_stream(
@@ -1060,7 +1060,7 @@ async fn reorg_changes_outgoing_tx_index() {
10601060
)
10611061
.await;
10621062

1063-
_ = connector.apply_staged(211).await;
1063+
_ = connector.apply_staged(312).await;
10641064

10651065
let reorg_sync_result = light_client.do_sync(true).await;
10661066

darkside-tests/tests/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ async fn sent_transaction_reorged_into_mempool() {
181181
.await
182182
.unwrap();
183183
let connector = DarksideConnector(server_id.clone());
184-
connector.stage_blocks_create(4, 1, 0).await.unwrap();
185-
connector.apply_staged(4).await.unwrap();
184+
connector.stage_blocks_create(4, 102, 0).await.unwrap();
185+
connector.apply_staged(105).await.unwrap();
186186
sleep(std::time::Duration::from_secs(1)).await;
187187

188188
recipient.do_sync(false).await.unwrap();

libtonode-tests/tests/concrete.rs

Lines changed: 6 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,10 +1084,10 @@ mod slow {
10841084
scenarios::faucet_recipient_default().await;
10851085

10861086
// 2. Get an incoming transaction to a t address
1087-
let taddr = get_base_address_macro!(recipient, "transparent");
1087+
let recipient_taddr = get_base_address_macro!(recipient, "transparent");
10881088
let value = 100_000;
10891089

1090-
from_inputs::quick_send(&faucet, vec![(taddr.as_str(), value, None)])
1090+
from_inputs::quick_send(&faucet, vec![(recipient_taddr.as_str(), value, None)])
10911091
.await
10921092
.unwrap();
10931093

@@ -1099,7 +1099,10 @@ mod slow {
10991099
// 3. Test the list
11001100
let list = recipient.do_list_transactions().await;
11011101
assert_eq!(list[0]["block_height"].as_u64().unwrap(), 4);
1102-
assert_eq!(list[0]["address"], taddr);
1102+
assert_eq!(
1103+
recipient.do_addresses().await[0]["receivers"]["transparent"].to_string(),
1104+
recipient_taddr
1105+
);
11031106
assert_eq!(list[0]["amount"].as_u64().unwrap(), value);
11041107

11051108
// 4. We can't spend the funds, as they're transparent. We need to shield first
@@ -3228,69 +3231,6 @@ mod slow {
32283231
serde_json::to_string_pretty(&recipient.do_balance().await).unwrap()
32293232
);
32303233
}
3231-
#[tokio::test]
3232-
async fn dont_write_pending() {
3233-
let regtest_network = RegtestNetwork::all_upgrades_active();
3234-
let (regtest_manager, _cph, faucet, recipient) = scenarios::faucet_recipient(
3235-
PoolType::Shielded(ShieldedProtocol::Orchard),
3236-
regtest_network,
3237-
)
3238-
.await;
3239-
from_inputs::quick_send(
3240-
&faucet,
3241-
vec![(
3242-
&get_base_address_macro!(recipient, "unified"),
3243-
100_000,
3244-
Some("funding to be received by the recipient"),
3245-
)],
3246-
)
3247-
.await
3248-
.unwrap();
3249-
3250-
zingolib::testutils::increase_height_and_wait_for_client(&regtest_manager, &recipient, 2)
3251-
.await
3252-
.unwrap();
3253-
let recipient_balance = recipient.do_balance().await;
3254-
assert_eq!(
3255-
recipient_balance,
3256-
PoolBalances {
3257-
sapling_balance: Some(0),
3258-
verified_sapling_balance: Some(0),
3259-
spendable_sapling_balance: Some(0),
3260-
unverified_sapling_balance: Some(0),
3261-
orchard_balance: Some(100000),
3262-
verified_orchard_balance: Some(100000),
3263-
spendable_orchard_balance: Some(100000),
3264-
unverified_orchard_balance: Some(0),
3265-
transparent_balance: Some(0)
3266-
}
3267-
);
3268-
from_inputs::quick_send(
3269-
&recipient,
3270-
vec![(
3271-
&get_base_address_macro!(faucet, "unified"),
3272-
25_000,
3273-
Some("an pending transaction, that shall not be synced"),
3274-
)],
3275-
)
3276-
.await
3277-
.unwrap();
3278-
let recipient_balance = recipient.do_balance().await;
3279-
3280-
dbg!(&recipient_balance.unverified_orchard_balance);
3281-
assert_eq!(
3282-
recipient_balance.unverified_orchard_balance.unwrap(),
3283-
65_000
3284-
);
3285-
3286-
let loaded_client =
3287-
zingolib::testutils::lightclient::new_client_from_save_buffer(&recipient)
3288-
.await
3289-
.unwrap();
3290-
let loaded_balance = loaded_client.do_balance().await;
3291-
assert_eq!(loaded_balance.unverified_orchard_balance, Some(0),);
3292-
check_client_balances!(loaded_client, o: 100_000 s: 0 t: 0 );
3293-
}
32943234

32953235
#[tokio::test]
32963236
async fn by_address_finsight() {

libtonode-tests/tests/wallet.rs

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,37 +101,40 @@ mod load_wallet {
101101
);
102102
let expected_pre_sync_transactions = r#"[
103103
{
104+
"outgoing_metadata": [],
105+
"amount": 100000,
106+
"memo": "null, null",
104107
"block_height": 3,
105108
"pending": false,
106109
"datetime": 1692212261,
107110
"position": 0,
108111
"txid": "7a9d41caca143013ebd2f710e4dad04f0eb9f0ae98b42af0f58f25c61a9d439e",
109-
"amount": 100000,
110112
"zec_price": null,
111-
"address": "uregtest1wdukkmv5p5n824e8ytnc3m6m77v9vwwl7hcpj0wangf6z23f9x0fnaen625dxgn8cgp67vzw6swuar6uwp3nqywfvvkuqrhdjffxjfg644uthqazrtxhrgwac0a6ujzgwp8y9cwthjeayq8r0q6786yugzzyt9vevxn7peujlw8kp3vf6d8p4fvvpd8qd5p7xt2uagelmtf3vl6w3u8",
112-
"memo": null
113+
"address": "uregtest1wdukkmv5p5n824e8ytnc3m6m77v9vwwl7hcpj0wangf6z23f9x0fnaen625dxgn8cgp67vzw6swuar6uwp3nqywfvvkuqrhdjffxjfg644uthqazrtxhrgwac0a6ujzgwp8y9cwthjeayq8r0q6786yugzzyt9vevxn7peujlw8kp3vf6d8p4fvvpd8qd5p7xt2uagelmtf3vl6w3u8"
113114
},
114115
{
116+
"outgoing_metadata": [],
117+
"amount": 50000,
118+
"memo": "null, null",
115119
"block_height": 8,
116120
"pending": false,
117121
"datetime": 1692212266,
118122
"position": 0,
119123
"txid": "122f8ab8dc5483e36256a4fbd7ff8d60eb7196670716a6690f9215f1c2a4d841",
120-
"amount": 50000,
121124
"zec_price": null,
122-
"address": "uregtest1wdukkmv5p5n824e8ytnc3m6m77v9vwwl7hcpj0wangf6z23f9x0fnaen625dxgn8cgp67vzw6swuar6uwp3nqywfvvkuqrhdjffxjfg644uthqazrtxhrgwac0a6ujzgwp8y9cwthjeayq8r0q6786yugzzyt9vevxn7peujlw8kp3vf6d8p4fvvpd8qd5p7xt2uagelmtf3vl6w3u8",
123-
"memo": null
125+
"address": "uregtest1wdukkmv5p5n824e8ytnc3m6m77v9vwwl7hcpj0wangf6z23f9x0fnaen625dxgn8cgp67vzw6swuar6uwp3nqywfvvkuqrhdjffxjfg644uthqazrtxhrgwac0a6ujzgwp8y9cwthjeayq8r0q6786yugzzyt9vevxn7peujlw8kp3vf6d8p4fvvpd8qd5p7xt2uagelmtf3vl6w3u8"
124126
},
125127
{
128+
"outgoing_metadata": [],
129+
"amount": 30000,
130+
"memo": "null, null",
126131
"block_height": 9,
127132
"pending": false,
128133
"datetime": 1692212299,
129134
"position": 0,
130135
"txid": "0a014017add7dc9eb57ada3e70f905c9dce610ef055e135b03f4907dd5dc99a4",
131-
"amount": 30000,
132136
"zec_price": null,
133-
"address": "uregtest1wdukkmv5p5n824e8ytnc3m6m77v9vwwl7hcpj0wangf6z23f9x0fnaen625dxgn8cgp67vzw6swuar6uwp3nqywfvvkuqrhdjffxjfg644uthqazrtxhrgwac0a6ujzgwp8y9cwthjeayq8r0q6786yugzzyt9vevxn7peujlw8kp3vf6d8p4fvvpd8qd5p7xt2uagelmtf3vl6w3u8",
134-
"memo": null
137+
"address": "uregtest1wdukkmv5p5n824e8ytnc3m6m77v9vwwl7hcpj0wangf6z23f9x0fnaen625dxgn8cgp67vzw6swuar6uwp3nqywfvvkuqrhdjffxjfg644uthqazrtxhrgwac0a6ujzgwp8y9cwthjeayq8r0q6786yugzzyt9vevxn7peujlw8kp3vf6d8p4fvvpd8qd5p7xt2uagelmtf3vl6w3u8"
135138
}
136139
]"#;
137140
assert_eq!(
@@ -141,26 +144,28 @@ mod load_wallet {
141144
recipient.do_sync(false).await.unwrap();
142145
let expected_post_sync_transactions = r#"[
143146
{
147+
"outgoing_metadata": [],
148+
"amount": 100000,
149+
"memo": "null, null",
144150
"block_height": 3,
145151
"pending": false,
146152
"datetime": 1692212261,
147153
"position": 0,
148154
"txid": "7a9d41caca143013ebd2f710e4dad04f0eb9f0ae98b42af0f58f25c61a9d439e",
149-
"amount": 100000,
150155
"zec_price": null,
151-
"address": "uregtest1wdukkmv5p5n824e8ytnc3m6m77v9vwwl7hcpj0wangf6z23f9x0fnaen625dxgn8cgp67vzw6swuar6uwp3nqywfvvkuqrhdjffxjfg644uthqazrtxhrgwac0a6ujzgwp8y9cwthjeayq8r0q6786yugzzyt9vevxn7peujlw8kp3vf6d8p4fvvpd8qd5p7xt2uagelmtf3vl6w3u8",
152-
"memo": null
156+
"address": "uregtest1wdukkmv5p5n824e8ytnc3m6m77v9vwwl7hcpj0wangf6z23f9x0fnaen625dxgn8cgp67vzw6swuar6uwp3nqywfvvkuqrhdjffxjfg644uthqazrtxhrgwac0a6ujzgwp8y9cwthjeayq8r0q6786yugzzyt9vevxn7peujlw8kp3vf6d8p4fvvpd8qd5p7xt2uagelmtf3vl6w3u8"
153157
},
154158
{
159+
"outgoing_metadata": [],
160+
"amount": 50000,
161+
"memo": "null, null",
155162
"block_height": 8,
156163
"pending": false,
157164
"datetime": 1692212266,
158165
"position": 0,
159166
"txid": "122f8ab8dc5483e36256a4fbd7ff8d60eb7196670716a6690f9215f1c2a4d841",
160-
"amount": 50000,
161167
"zec_price": null,
162-
"address": "uregtest1wdukkmv5p5n824e8ytnc3m6m77v9vwwl7hcpj0wangf6z23f9x0fnaen625dxgn8cgp67vzw6swuar6uwp3nqywfvvkuqrhdjffxjfg644uthqazrtxhrgwac0a6ujzgwp8y9cwthjeayq8r0q6786yugzzyt9vevxn7peujlw8kp3vf6d8p4fvvpd8qd5p7xt2uagelmtf3vl6w3u8",
163-
"memo": null
168+
"address": "uregtest1wdukkmv5p5n824e8ytnc3m6m77v9vwwl7hcpj0wangf6z23f9x0fnaen625dxgn8cgp67vzw6swuar6uwp3nqywfvvkuqrhdjffxjfg644uthqazrtxhrgwac0a6ujzgwp8y9cwthjeayq8r0q6786yugzzyt9vevxn7peujlw8kp3vf6d8p4fvvpd8qd5p7xt2uagelmtf3vl6w3u8"
164169
}
165170
]"#;
166171
assert_eq!(

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.81"
2+
channel = "1.82"
33
components = [ "clippy", "rustfmt" ]

zingo-memo/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub enum ParsedMemo {
3131
/// the list of unified addresses
3232
uas: Vec<UnifiedAddress>,
3333
/// The ephemeral address indexes
34-
ephemeral_address_indexes: Vec<u32>,
34+
rejection_address_indexes: Vec<u32>,
3535
},
3636
}
3737

@@ -99,7 +99,7 @@ pub fn parse_zingo_memo(memo: [u8; 511]) -> io::Result<ParsedMemo> {
9999
}),
100100
1 => Ok(ParsedMemo::Version1 {
101101
uas: Vector::read(&mut reader, |r| read_unified_address_from_raw_encoding(r))?,
102-
ephemeral_address_indexes: Vector::read(&mut reader, |r| CompactSize::read_t(r))?,
102+
rejection_address_indexes: Vector::read(&mut reader, |r| CompactSize::read_t(r))?,
103103
}),
104104
_ => Err(io::Error::new(
105105
io::ErrorKind::InvalidData,

zingo-netutils/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use client::client_from_connector;
1010
use http::{uri::PathAndQuery, Uri};
1111
use http_body_util::combinators::UnsyncBoxBody;
1212
use hyper_util::client::legacy::connect::HttpConnector;
13-
use thiserror::Error;
1413
use tokio_rustls::rustls::pki_types::{Der, TrustAnchor};
1514
use tokio_rustls::rustls::{ClientConfig, RootCertStore};
1615
use tonic::Status;
@@ -26,7 +25,7 @@ pub type UnderlyingService = BoxCloneService<
2625
>;
2726

2827
#[allow(missing_docs)] // error types document themselves
29-
#[derive(Debug, Error)]
28+
#[derive(Debug, thiserror::Error)]
3029
pub enum GetClientError {
3130
#[error("bad uri: invalid scheme")]
3231
InvalidScheme,

zingocli/src/lib.rs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,28 +84,30 @@ fn parse_uri(s: &str) -> Result<http::Uri, String> {
8484
/// currently this is just a whitespace delimited string of 24 words. I am
8585
/// poking around to use the actual BIP39 parser (presumably from librustzcash).
8686
fn parse_seed(s: &str) -> Result<String, String> {
87-
if let Ok(s) = s.parse::<String>() {
88-
let count = s.split_whitespace().count();
89-
if count == 24 {
90-
Ok(s)
91-
} else {
92-
Err(format!("Expected 24 words, but received: {}.", count))
87+
match s.parse::<String>() {
88+
Ok(s) => {
89+
let count = s.split_whitespace().count();
90+
if count == 24 {
91+
Ok(s)
92+
} else {
93+
Err(format!("Expected 24 words, but received: {}.", count))
94+
}
9395
}
94-
} else {
95-
Err("Unexpected failure to parse String!!".to_string())
96+
Err(_) => Err("Unexpected failure to parse String!!".to_string()),
9697
}
9798
}
9899
/// Parse encoded UFVK to String and check for whitespaces
99100
fn parse_ufvk(s: &str) -> Result<String, String> {
100-
if let Ok(s) = s.parse::<String>() {
101-
let count = s.split_whitespace().count();
102-
if count == 1 {
103-
Ok(s)
104-
} else {
105-
Err("Encoded UFVK should not contain whitespace!".to_string())
101+
match s.parse::<String>() {
102+
Ok(s) => {
103+
let count = s.split_whitespace().count();
104+
if count == 1 {
105+
Ok(s)
106+
} else {
107+
Err("Encoded UFVK should not contain whitespace!".to_string())
108+
}
106109
}
107-
} else {
108-
Err("Unexpected failure to parse String!!".to_string())
110+
Err(_) => Err("Unexpected failure to parse String!!".to_string()),
109111
}
110112
}
111113
#[cfg(target_os = "linux")]

zingolib/src/blaze/fetch_taddr_transactions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl FetchTaddrTransactions {
5050
.iter()
5151
.filter_map(|ua| ua.transparent())
5252
.chain(
53-
wc.transparent_child_ephemeral_addresses()
53+
wc.get_rejection_addresses()
5454
.iter()
5555
.map(|(taddr, _metadata)| taddr),
5656
)

zingolib/src/lightclient/describe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ impl LightClient {
508508
create_send_value_transfers(&mut value_transfers, tx);
509509
}
510510
TransactionKind::Received => {
511-
// create 1 received value tansfer for each pool recieved to
511+
// create 1 received value tansfer for each pool received to
512512
if !tx.orchard_notes().is_empty() {
513513
let value: u64 =
514514
tx.orchard_notes().iter().map(|output| output.value()).sum();

0 commit comments

Comments
 (0)