File tree Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -850,12 +850,11 @@ impl<K: AccountKeyChains> Account<K> {
850
850
. into_iter ( )
851
851
. filter ( |( _, pool_data) | match filter {
852
852
WalletPoolsFilter :: All => true ,
853
- // FIXME for standalone private keys
854
853
WalletPoolsFilter :: Decommission => {
855
- self . key_chain . is_destination_mine ( & pool_data. decommission_key )
854
+ self . key_chain . has_private_key_for_destination ( & pool_data. decommission_key )
856
855
}
857
856
WalletPoolsFilter :: Stake => {
858
- self . key_chain . is_destination_mine ( & pool_data. stake_destination )
857
+ self . key_chain . has_private_key_for_destination ( & pool_data. stake_destination )
859
858
}
860
859
} )
861
860
. collect ( )
Original file line number Diff line number Diff line change @@ -432,6 +432,11 @@ impl<V: VrfKeyChain> AccountKeyChains for AccountKeyChainImpl<V> {
432
432
Ok ( ( ) )
433
433
}
434
434
435
+ fn has_private_key_for_destination ( & self , destination : & Destination ) -> bool {
436
+ self . is_destination_mine ( destination)
437
+ || self . standalone_private_keys . contains_key ( destination)
438
+ }
439
+
435
440
// Return true if the provided destination belongs to this key chain
436
441
fn is_destination_mine ( & self , destination : & Destination ) -> bool {
437
442
KeyPurpose :: ALL
Original file line number Diff line number Diff line change @@ -60,4 +60,6 @@ fn check_mine_methods(#[case] public: &str) {
60
60
assert ! ( key_chain. is_public_key_hash_mine( & pkh) ) ;
61
61
assert ! ( key_chain. is_destination_mine( & addr_destination) ) ;
62
62
assert ! ( key_chain. is_destination_mine( & pk_destination) ) ;
63
+ assert ! ( key_chain. has_private_key_for_destination( & addr_destination) ) ;
64
+ assert ! ( key_chain. has_private_key_for_destination( & pk_destination) ) ;
63
65
}
Original file line number Diff line number Diff line change @@ -187,6 +187,9 @@ where
187
187
// Return true if the provided destination belongs to this key chain
188
188
fn is_destination_mine ( & self , destination : & Destination ) -> bool ;
189
189
190
+ // Return true if we have the private key for the provided destination
191
+ fn has_private_key_for_destination ( & self , destination : & Destination ) -> bool ;
192
+
190
193
// Return true if the provided public key belongs to this key chain
191
194
fn is_public_key_mine ( & self , public_key : & PublicKey ) -> bool ;
192
195
You can’t perform that action at this time.
0 commit comments