Skip to content

Commit 9169c5a

Browse files
OttoAllmendingerllm-git
andcommitted
feat(wasm-utxo): update test utils to use XprvTriple directly
Use fixtures::XprvTriple instead of RootWalletKeys in test utils to simplify signature testing with wallets. Issue: BTC-2652 Co-authored-by: llm-git <[email protected]>
1 parent 2e6c5a4 commit 9169c5a

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

packages/wasm-utxo/src/bitgo_psbt/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,27 +390,27 @@ mod tests {
390390
network: Network,
391391
tx_format: fixtures::TxFormat,
392392
unsigned_bitgo_psbt: &BitGoPsbt,
393-
wallet_keys: &RootWalletKeys,
393+
wallet_keys: &fixtures::XprvTriple,
394394
input_index: usize,
395395
input_fixture: &fixtures::PsbtInputFixture,
396396
halfsigned_fixture: &fixtures::PsbtInputFixture,
397397
) -> Result<(), String> {
398-
// todo!()
398+
let user_key = wallet_keys.user_key();
399399
Ok(())
400400
}
401401

402402
fn assert_full_signed_matches_wallet_scripts(
403403
network: Network,
404404
tx_format: fixtures::TxFormat,
405405
fixture: &fixtures::PsbtFixture,
406-
wallet_keys: &RootWalletKeys,
406+
wallet_keys: &fixtures::XprvTriple,
407407
input_index: usize,
408408
input_fixture: &fixtures::PsbtInputFixture,
409409
) -> Result<(), String> {
410410
let (chain, index) =
411411
parse_fixture_paths(input_fixture).expect("Failed to parse fixture paths");
412412
let scripts = WalletScripts::from_wallet_keys(
413-
wallet_keys,
413+
&wallet_keys.to_root_wallet_keys(),
414414
chain,
415415
index,
416416
&network.output_script_support(),

packages/wasm-utxo/src/fixed_script_wallet/test_utils/fixtures.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ pub struct PsbtFixture {
525525
pub struct PsbtStages {
526526
pub network: Network,
527527
pub tx_format: TxFormat,
528-
pub wallet_keys: crate::fixed_script_wallet::RootWalletKeys,
528+
pub wallet_keys: XprvTriple,
529529
pub unsigned: PsbtFixture,
530530
pub halfsigned: PsbtFixture,
531531
pub fullsigned: PsbtFixture,
@@ -562,12 +562,11 @@ impl PsbtStages {
562562
.expect("Failed to parse wallet keys");
563563
assert_eq!(wallet_keys_unsigned, wallet_keys_halfsigned);
564564
assert_eq!(wallet_keys_unsigned, wallet_keys_fullsigned);
565-
let wallet_keys = wallet_keys_unsigned.to_root_wallet_keys();
566565

567566
Ok(Self {
568567
network,
569568
tx_format,
570-
wallet_keys,
569+
wallet_keys: wallet_keys_unsigned.clone(),
571570
unsigned,
572571
halfsigned,
573572
fullsigned,
@@ -578,7 +577,7 @@ impl PsbtStages {
578577
pub struct PsbtInputStages {
579578
pub network: Network,
580579
pub tx_format: TxFormat,
581-
pub wallet_keys: crate::fixed_script_wallet::RootWalletKeys,
580+
pub wallet_keys: XprvTriple,
582581
pub wallet_script_type: ScriptType,
583582
pub input_index: usize,
584583
pub input_fixture_unsigned: PsbtInputFixture,

0 commit comments

Comments
 (0)