Skip to content

Commit 7266bf4

Browse files
committed
Fix web.rs upgrade_wallet call. Order mnemonic first to make it easier to recover in the future.
1 parent 1f3ac16 commit 7266bf4

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/structs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ pub struct PublicWalletData {
5151
#[derive(Serialize, Deserialize, Clone, Debug)]
5252
#[serde(rename_all = "camelCase")]
5353
pub struct EncryptedWalletData {
54+
pub mnemonic: String,
5455
pub private: PrivateWalletData,
5556
pub public: PublicWalletData,
56-
pub mnemonic: String,
5757
}
5858

5959
#[derive(Serialize, Deserialize, Clone, Debug)]

src/web.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,17 @@ pub mod bitcoin {
111111
}
112112

113113
#[wasm_bindgen]
114-
pub fn upgrade_wallet(password: String, encrypted_descriptors: String) -> Promise {
114+
pub fn upgrade_wallet(
115+
password: String,
116+
encrypted_descriptors: String,
117+
seed_password: String,
118+
) -> Promise {
115119
set_panic_hook();
116120

117121
future_to_promise(async move {
118-
match crate::bitcoin::upgrade_wallet(&password, &encrypted_descriptors) {
122+
match crate::bitcoin::upgrade_wallet(&password, &encrypted_descriptors, &seed_password)
123+
.await
124+
{
119125
Ok(result) => Ok(JsValue::from_string(
120126
serde_json::to_string(&result).unwrap(),
121127
)),

0 commit comments

Comments
 (0)