From e3861f251b187317dbabfa51c72e0ebafe850fe2 Mon Sep 17 00:00:00 2001 From: david barinas Date: Tue, 30 Apr 2024 17:42:38 -0500 Subject: [PATCH] refactor: Simplify logic by adding a check for empty path before deriving the key --- libwallet/src/vault.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libwallet/src/vault.rs b/libwallet/src/vault.rs index f0c7a73..a0ba68a 100644 --- a/libwallet/src/vault.rs +++ b/libwallet/src/vault.rs @@ -60,6 +60,10 @@ mod utils { where Self: Sized, { + if path.is_empty() { + return self.sub.derive("").into(); + } + match &path[..2] { #[cfg(feature = "substrate")] "//" => self.sub.derive(path).into(),