@@ -471,11 +471,11 @@ macro_rules! impl_client_v17__walletprocesspsbt {
471
471
macro_rules! impl_client_v17__abandontransaction {
472
472
( ) => {
473
473
impl Client {
474
- pub fn abandon_transaction( & self , txid: Txid ) -> Result <( ) > {
474
+ pub fn abandon_transaction( & self , txid: Txid ) -> Result <AbandonTransaction > {
475
475
match self . call( "abandontransaction" , & [ into_json( txid) ?] ) {
476
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
477
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
478
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!( "abandontransaction expected null, got: {}" , other) ) ) ,
476
+ Ok ( serde_json:: Value :: Null ) => Ok ( AbandonTransaction ) ,
477
+ Ok ( ref val) if val. is_null( ) => Ok ( AbandonTransaction ) ,
478
+ Ok ( other) => Err ( Error :: Returned ( format!( "abandontransaction expected null, got: {}" , other) ) ) ,
479
479
Err ( e) => Err ( e. into( ) ) ,
480
480
}
481
481
}
@@ -488,11 +488,11 @@ macro_rules! impl_client_v17__abandontransaction {
488
488
macro_rules! impl_client_v17__abortrescan {
489
489
( ) => {
490
490
impl Client {
491
- pub fn abort_rescan( & self ) -> Result <( ) > {
491
+ pub fn abort_rescan( & self ) -> Result <AbortRescan > {
492
492
match self . call( "abortrescan" , & [ ] ) {
493
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
494
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
495
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!( "abortrescan expected null, got: {}" , other) ) ) ,
493
+ Ok ( serde_json:: Value :: Null ) => Ok ( AbortRescan ) ,
494
+ Ok ( ref val) if val. is_null( ) => Ok ( AbortRescan ) ,
495
+ Ok ( other) => Err ( Error :: Returned ( format!( "abortrescan expected null, got: {}" , other) ) ) ,
496
496
Err ( e) => Err ( e. into( ) ) ,
497
497
}
498
498
}
@@ -505,12 +505,12 @@ macro_rules! impl_client_v17__abortrescan {
505
505
macro_rules! impl_client_v17__backupwallet {
506
506
( ) => {
507
507
impl Client {
508
- pub fn backup_wallet( & self , destination: & Path ) -> Result <( ) > {
508
+ pub fn backup_wallet( & self , destination: & Path ) -> Result <BackupWallet > {
509
509
let dest_str = destination. to_string_lossy( ) ;
510
510
match self . call( "backupwallet" , & [ dest_str. as_ref( ) . into( ) ] ) {
511
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
512
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
513
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!( "backupwallet expected null, got: {}" , other) ) ) ,
511
+ Ok ( serde_json:: Value :: Null ) => Ok ( BackupWallet ) ,
512
+ Ok ( ref val) if val. is_null( ) => Ok ( BackupWallet ) ,
513
+ Ok ( other) => Err ( Error :: Returned ( format!( "backupwallet expected null, got: {}" , other) ) ) ,
514
514
Err ( e) => Err ( e. into( ) ) ,
515
515
}
516
516
}
@@ -523,11 +523,11 @@ macro_rules! impl_client_v17__backupwallet {
523
523
macro_rules! impl_client_v17__encryptwallet {
524
524
( ) => {
525
525
impl Client {
526
- pub fn encrypt_wallet( & self , passphrase: & str ) -> Result <( ) > {
526
+ pub fn encrypt_wallet( & self , passphrase: & str ) -> Result <EncryptWallet > {
527
527
match self . call( "encryptwallet" , & [ passphrase. into( ) ] ) {
528
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
529
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
530
- Ok ( _ ) => Ok ( ( ) ) ,
528
+ Ok ( serde_json:: Value :: Null ) => Ok ( EncryptWallet ) ,
529
+ Ok ( ref val) if val. is_null( ) => Ok ( EncryptWallet ) ,
530
+ Ok ( other ) => Err ( Error :: Returned ( format! ( "encryptwallet v17-v19 expected null, got: {}" , other ) ) ) ,
531
531
Err ( e) => Err ( e. into( ) ) ,
532
532
}
533
533
}
@@ -546,7 +546,7 @@ macro_rules! impl_client_v17__importaddress {
546
546
label: Option <& str >,
547
547
rescan: Option <bool >,
548
548
p2sh: Option <bool >,
549
- ) -> Result <( ) > {
549
+ ) -> Result <ImportAddress > {
550
550
let mut params = vec![ address_or_script. into( ) ] ;
551
551
552
552
if label. is_some( ) || rescan. is_some( ) || p2sh. is_some( ) {
@@ -562,9 +562,9 @@ macro_rules! impl_client_v17__importaddress {
562
562
}
563
563
564
564
match self . call( "importaddress" , & params) {
565
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
566
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
567
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!(
565
+ Ok ( serde_json:: Value :: Null ) => Ok ( ImportAddress ) ,
566
+ Ok ( ref val) if val. is_null( ) => Ok ( ImportAddress ) ,
567
+ Ok ( other) => Err ( Error :: Returned ( format!(
568
568
"importaddress expected null, got: {}" , other
569
569
) ) ) ,
570
570
Err ( e) => Err ( e. into( ) ) ,
@@ -583,11 +583,11 @@ macro_rules! impl_client_v17__importprunedfunds {
583
583
& self ,
584
584
raw_transaction: & str ,
585
585
txout_proof: & str ,
586
- ) -> Result <( ) > {
586
+ ) -> Result <ImportPrunedFunds > {
587
587
match self . call( "importprunedfunds" , & [ raw_transaction. into( ) , txout_proof. into( ) ] ) {
588
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
589
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
590
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!(
588
+ Ok ( serde_json:: Value :: Null ) => Ok ( ImportPrunedFunds ) ,
589
+ Ok ( ref val) if val. is_null( ) => Ok ( ImportPrunedFunds ) ,
590
+ Ok ( other) => Err ( Error :: Returned ( format!(
591
591
"importprunedfunds expected null, got: {}" , other
592
592
) ) ) ,
593
593
Err ( e) => Err ( e. into( ) ) ,
@@ -607,7 +607,7 @@ macro_rules! impl_client_v17__importpubkey {
607
607
pubkey: & PublicKey ,
608
608
label: Option <& str >,
609
609
rescan: Option <bool >,
610
- ) -> Result <( ) > {
610
+ ) -> Result <ImportPubKey > {
611
611
let pubkey_hex = pubkey. to_string( ) ;
612
612
let mut params = vec![ pubkey_hex. into( ) ] ;
613
613
@@ -620,9 +620,9 @@ macro_rules! impl_client_v17__importpubkey {
620
620
}
621
621
622
622
match self . call( "importpubkey" , & params) {
623
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
624
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
625
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!(
623
+ Ok ( serde_json:: Value :: Null ) => Ok ( ImportPubKey ) ,
624
+ Ok ( ref val) if val. is_null( ) => Ok ( ImportPubKey ) ,
625
+ Ok ( other) => Err ( Error :: Returned ( format!(
626
626
"importpubkey expected null, got: {}" , other
627
627
) ) ) ,
628
628
Err ( e) => Err ( e. into( ) ) ,
@@ -637,12 +637,12 @@ macro_rules! impl_client_v17__importpubkey {
637
637
macro_rules! impl_client_v17__importwallet {
638
638
( ) => {
639
639
impl Client {
640
- pub fn import_wallet( & self , filename: & Path ) -> Result <( ) > {
640
+ pub fn import_wallet( & self , filename: & Path ) -> Result <ImportWallet > {
641
641
let filename_str = filename. to_string_lossy( ) ;
642
642
match self . call( "importwallet" , & [ filename_str. as_ref( ) . into( ) ] ) {
643
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
644
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
645
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!( "importwallet expected null, got: {}" , other) ) ) ,
643
+ Ok ( serde_json:: Value :: Null ) => Ok ( ImportWallet ) ,
644
+ Ok ( ref val) if val. is_null( ) => Ok ( ImportWallet ) ,
645
+ Ok ( other) => Err ( Error :: Returned ( format!( "importwallet expected null, got: {}" , other) ) ) ,
646
646
Err ( e) => Err ( e. into( ) ) ,
647
647
}
648
648
}
@@ -655,16 +655,16 @@ macro_rules! impl_client_v17__importwallet {
655
655
macro_rules! impl_client_v17__keypoolrefill {
656
656
( ) => {
657
657
impl Client {
658
- pub fn keypool_refill( & self , new_size: Option <usize >) -> Result <( ) > {
658
+ pub fn keypool_refill( & self , new_size: Option <usize >) -> Result <KeypoolRefill > {
659
659
let params = match new_size {
660
660
Some ( size) => vec![ size. into( ) ] ,
661
661
None => vec![ ] ,
662
662
} ;
663
663
664
664
match self . call( "keypoolrefill" , & params) {
665
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
666
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
667
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!( "keypoolrefill expected null, got: {}" , other) ) ) ,
665
+ Ok ( serde_json:: Value :: Null ) => Ok ( KeypoolRefill ) ,
666
+ Ok ( ref val) if val. is_null( ) => Ok ( KeypoolRefill ) ,
667
+ Ok ( other) => Err ( Error :: Returned ( format!( "keypoolrefill expected null, got: {}" , other) ) ) ,
668
668
Err ( e) => Err ( e. into( ) ) ,
669
669
}
670
670
}
@@ -683,7 +683,7 @@ macro_rules! impl_client_v17__lockunspent {
683
683
unlock: bool ,
684
684
outputs: Option <& [ LockUnspentOutput ] >,
685
685
persistent: Option <bool >,
686
- ) -> Result <bool > {
686
+ ) -> Result <LockUnspent > {
687
687
let mut params = vec![ unlock. into( ) ] ;
688
688
689
689
match outputs {
@@ -692,7 +692,7 @@ macro_rules! impl_client_v17__lockunspent {
692
692
if unlock {
693
693
params. push( serde_json:: Value :: Array ( vec![ ] ) ) ;
694
694
} else {
695
- return Err ( crate :: client_sync :: Error :: Returned ( "lockunspent requires specific outputs when locking (unlock=false)" . to_string( ) ) ) ;
695
+ return Err ( Error :: Returned ( "lockunspent requires specific outputs when locking (unlock=false)" . to_string( ) ) ) ;
696
696
}
697
697
}
698
698
}
@@ -716,11 +716,11 @@ macro_rules! impl_client_v17__lockunspent {
716
716
macro_rules! impl_client_v17__removeprunedfunds {
717
717
( ) => {
718
718
impl Client {
719
- pub fn remove_pruned_funds( & self , txid: Txid ) -> Result <( ) > {
719
+ pub fn remove_pruned_funds( & self , txid: Txid ) -> Result <RemovePrunedFunds > {
720
720
match self . call( "removeprunedfunds" , & [ into_json( txid) ?] ) {
721
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
722
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
723
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!( "removeprunedfunds expected null, got: {}" , other) ) ) ,
721
+ Ok ( serde_json:: Value :: Null ) => Ok ( RemovePrunedFunds ) ,
722
+ Ok ( ref val) if val. is_null( ) => Ok ( RemovePrunedFunds ) ,
723
+ Ok ( other) => Err ( Error :: Returned ( format!( "removeprunedfunds expected null, got: {}" , other) ) ) ,
724
724
Err ( e) => Err ( e. into( ) ) ,
725
725
}
726
726
}
@@ -737,7 +737,7 @@ macro_rules! impl_client_v17__sethdseed {
737
737
& self ,
738
738
new_keypool: Option <bool >,
739
739
seed: Option <& PrivateKey >,
740
- ) -> Result <( ) > {
740
+ ) -> Result <SetHdSeed > {
741
741
let mut params = vec![ ] ;
742
742
743
743
if new_keypool. is_some( ) || seed. is_some( ) {
@@ -749,9 +749,9 @@ macro_rules! impl_client_v17__sethdseed {
749
749
}
750
750
751
751
match self . call( "sethdseed" , & params) {
752
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
753
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
754
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!( "sethdseed expected null, got: {}" , other) ) ) ,
752
+ Ok ( serde_json:: Value :: Null ) => Ok ( SetHdSeed ) ,
753
+ Ok ( ref val) if val. is_null( ) => Ok ( SetHdSeed ) ,
754
+ Ok ( other) => Err ( Error :: Returned ( format!( "sethdseed expected null, got: {}" , other) ) ) ,
755
755
Err ( e) => Err ( e. into( ) ) ,
756
756
}
757
757
}
@@ -771,7 +771,7 @@ macro_rules! impl_client_v17__settxfee {
771
771
}
772
772
773
773
impl Client {
774
- pub fn set_tx_fee( & self , fee_rate: bitcoin:: FeeRate ) -> Result <bool > {
774
+ pub fn set_tx_fee( & self , fee_rate: bitcoin:: FeeRate ) -> Result <SetTxFee > {
775
775
let amount_rpc_arg = fee_rate_to_rpc_arg_settxfee( fee_rate) ;
776
776
777
777
self . call( "settxfee" , & [ amount_rpc_arg. into( ) ] )
@@ -785,11 +785,11 @@ macro_rules! impl_client_v17__settxfee {
785
785
macro_rules! impl_client_v17__walletlock {
786
786
( ) => {
787
787
impl Client {
788
- pub fn wallet_lock( & self ) -> Result <( ) > {
788
+ pub fn wallet_lock( & self ) -> Result <WalletLock > {
789
789
match self . call( "walletlock" , & [ ] ) {
790
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
791
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
792
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!( "walletlock expected null, got: {}" , other) ) ) ,
790
+ Ok ( serde_json:: Value :: Null ) => Ok ( WalletLock ) ,
791
+ Ok ( ref val) if val. is_null( ) => Ok ( WalletLock ) ,
792
+ Ok ( other) => Err ( Error :: Returned ( format!( "walletlock expected null, got: {}" , other) ) ) ,
793
793
Err ( e) => Err ( e. into( ) ) ,
794
794
}
795
795
}
@@ -802,11 +802,11 @@ macro_rules! impl_client_v17__walletlock {
802
802
macro_rules! impl_client_v17__walletpassphrase {
803
803
( ) => {
804
804
impl Client {
805
- pub fn wallet_passphrase( & self , passphrase: & str , timeout: u64 ) -> Result <( ) > {
805
+ pub fn wallet_passphrase( & self , passphrase: & str , timeout: u64 ) -> Result <WalletPassPhrase > {
806
806
match self . call( "walletpassphrase" , & [ passphrase. into( ) , timeout. into( ) ] ) {
807
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
808
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
809
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!( "walletpassphrase expected null, got: {}" , other) ) ) ,
807
+ Ok ( serde_json:: Value :: Null ) => Ok ( WalletPassPhrase ) ,
808
+ Ok ( ref val) if val. is_null( ) => Ok ( WalletPassPhrase ) ,
809
+ Ok ( other) => Err ( Error :: Returned ( format!( "walletpassphrase expected null, got: {}" , other) ) ) ,
810
810
Err ( e) => Err ( e. into( ) ) ,
811
811
}
812
812
}
@@ -819,11 +819,11 @@ macro_rules! impl_client_v17__walletpassphrase {
819
819
macro_rules! impl_client_v17__walletpassphrasechange {
820
820
( ) => {
821
821
impl Client {
822
- pub fn wallet_passphrase_change( & self , old_passphrase: & str , new_passphrase: & str ) -> Result <( ) > {
822
+ pub fn wallet_passphrase_change( & self , old_passphrase: & str , new_passphrase: & str ) -> Result <WalletPassPhraseChange > {
823
823
match self . call( "walletpassphrasechange" , & [ old_passphrase. into( ) , new_passphrase. into( ) ] ) {
824
- Ok ( serde_json:: Value :: Null ) => Ok ( ( ) ) ,
825
- Ok ( ref val) if val. is_null( ) => Ok ( ( ) ) ,
826
- Ok ( other) => Err ( crate :: client_sync :: Error :: Returned ( format!( "walletpassphrasechange expected null, got: {}" , other) ) ) ,
824
+ Ok ( serde_json:: Value :: Null ) => Ok ( WalletPassPhraseChange ) ,
825
+ Ok ( ref val) if val. is_null( ) => Ok ( WalletPassPhraseChange ) ,
826
+ Ok ( other) => Err ( Error :: Returned ( format!( "walletpassphrasechange expected null, got: {}" , other) ) ) ,
827
827
Err ( e) => Err ( e. into( ) ) ,
828
828
}
829
829
}
0 commit comments