Skip to content

Commit 0a30538

Browse files
committed
no longer keep account seed on the wallet struct
1 parent 7d11d44 commit 0a30538

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

common/client-libs/validator-client/src/signing/direct_wallet.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ pub struct DirectSecp256k1HdWallet {
3737
/// Base secret
3838
secret: bip39::Mnemonic,
3939

40-
/// BIP39 seed
41-
seed: [u8; 64],
42-
4340
/// Derived accounts
4441
#[zeroize(skip)]
4542
// unfortunately `dyn EcdsaSigner` does not guarantee Zeroize
@@ -168,7 +165,7 @@ impl DirectSecp256k1HdWalletBuilder {
168165
self,
169166
mnemonic: bip39::Mnemonic,
170167
) -> Result<DirectSecp256k1HdWallet, DirectSecp256k1HdWalletError> {
171-
let seed = mnemonic.to_seed(&self.bip39_password);
168+
let seed = Zeroizing::new(mnemonic.to_seed(&self.bip39_password));
172169
let prefix = self.prefix.clone();
173170
let accounts = self
174171
.hd_paths
@@ -178,13 +175,12 @@ impl DirectSecp256k1HdWalletBuilder {
178175
hd_path: hd_path.clone(),
179176
prefix: prefix.clone(),
180177
}
181-
.try_derive_account(seed)
178+
.try_derive_account(&seed)
182179
})
183180
.collect::<Result<_, _>>()?;
184181

185182
Ok(DirectSecp256k1HdWallet {
186183
accounts,
187-
seed,
188184
secret: mnemonic,
189185
})
190186
}

contracts/coconut-dkg/src/support/tests/fixtures.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn vk_share_fixture(owner: &str, index: u64) -> ContractVKShare {
1717
node_index: index,
1818
owner: Addr::unchecked(owner),
1919
epoch_id: index,
20-
verified: index.is_multiple_of(2),
20+
verified: index % 2 == 0,
2121
}
2222
}
2323

0 commit comments

Comments
 (0)