diff --git a/lib/Cargo.lock b/lib/Cargo.lock index baf8931..df000b4 100644 --- a/lib/Cargo.lock +++ b/lib/Cargo.lock @@ -1192,7 +1192,7 @@ dependencies = [ "blake3 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "silentdragonlitelib 0.1.0 (git+https://github.com/MyHush/silentdragonlite-cli?rev=d2887d07879a93bdd9b2c8bd12504bb977e82fe0)", + "silentdragonlitelib 0.1.0 (git+https://github.com/MyHush/silentdragonlite-cli?rev=07288de82d84b9bf35d1210ccc98eb1e4b757eb7)", ] [[package]] @@ -1655,7 +1655,7 @@ dependencies = [ [[package]] name = "silentdragonlitelib" version = "0.1.0" -source = "git+https://github.com/MyHush/silentdragonlite-cli?rev=d2887d07879a93bdd9b2c8bd12504bb977e82fe0#d2887d07879a93bdd9b2c8bd12504bb977e82fe0" +source = "git+https://github.com/MyHush/silentdragonlite-cli?rev=07288de82d84b9bf35d1210ccc98eb1e4b757eb7#07288de82d84b9bf35d1210ccc98eb1e4b757eb7" dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "bellman 0.1.0 (git+https://github.com/MyHush/librustzcash.git?rev=1a0204113d487cdaaf183c2967010e5214ff9e37)", @@ -2647,7 +2647,7 @@ dependencies = [ "checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" "checksum sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" "checksum signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" -"checksum silentdragonlitelib 0.1.0 (git+https://github.com/MyHush/silentdragonlite-cli?rev=d2887d07879a93bdd9b2c8bd12504bb977e82fe0)" = "" +"checksum silentdragonlitelib 0.1.0 (git+https://github.com/MyHush/silentdragonlite-cli?rev=07288de82d84b9bf35d1210ccc98eb1e4b757eb7)" = "" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" "checksum socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index a0e526e..5d7a33c 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -12,4 +12,4 @@ crate-type = ["staticlib"] libc = "0.2.58" lazy_static = "1.4.0" blake3 = "0.3.4" -silentdragonlitelib = { git = "https://github.com/MyHush/silentdragonlite-cli", rev = "d2887d07879a93bdd9b2c8bd12504bb977e82fe0" } +silentdragonlitelib = { git = "https://github.com/MyHush/silentdragonlite-cli", rev = "07288de82d84b9bf35d1210ccc98eb1e4b757eb7" } diff --git a/lib/silentdragonlitelib.h b/lib/silentdragonlitelib.h index fdea5db..638ac0c 100644 --- a/lib/silentdragonlitelib.h +++ b/lib/silentdragonlitelib.h @@ -9,7 +9,7 @@ extern bool litelib_wallet_exists (const char* chain_name); extern char * litelib_initialize_new (bool dangerous, const char* server); extern char * litelib_initialize_new_from_phrase (bool dangerous, const char* server, const char* seed, - unsigned long long birthday); + unsigned long long birthday, unsigned long long number); extern char * litelib_initialize_existing (bool dangerous, const char* server); extern char * litelib_execute (const char* s, const char* args); extern void litelib_rust_free_string (char* s); diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 4ac3bf0..174c2b8 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -102,7 +102,7 @@ pub extern fn litelib_initialize_new(dangerous: bool, server: *const c_char) -> /// Restore a wallet from the seed phrase #[no_mangle] pub extern fn litelib_initialize_new_from_phrase(dangerous: bool, server: *const c_char, - seed: *const c_char, birthday: u64) -> *mut c_char { + seed: *const c_char, birthday: u64, number: u64) -> *mut c_char { let server_str = unsafe { assert!(!server.is_null()); @@ -124,7 +124,7 @@ pub extern fn litelib_initialize_new_from_phrase(dangerous: bool, server: *const } }; - let lightclient = match LightClient::new_from_phrase(seed_str, &config, birthday) { + let lightclient = match LightClient::new_from_phrase(seed_str, &config, birthday, number, false) { Ok(l) => l, Err(e) => { let e_str = CString::new(format!("Error: {}", e)).unwrap(); diff --git a/src/firsttimewizard.cpp b/src/firsttimewizard.cpp index 76e60c6..9e360aa 100644 --- a/src/firsttimewizard.cpp +++ b/src/firsttimewizard.cpp @@ -242,10 +242,14 @@ bool RestoreSeedPage::validatePage() { return false; } +///Number + +QString number_str = form.number->text(); +qint64 number = number_str.toUInt(); // 3. Attempt to restore wallet with the seed phrase { char* resp = litelib_initialize_new_from_phrase(parent->dangerous, parent->server.toStdString().c_str(), - seed.toStdString().c_str(), birthday); + seed.toStdString().c_str(), birthday, number); QString reply = litelib_process_response(resp); if (reply.toUpper().trimmed() != "OK") { diff --git a/src/restoreseed.ui b/src/restoreseed.ui index 64bd43f..316dddb 100644 --- a/src/restoreseed.ui +++ b/src/restoreseed.ui @@ -6,8 +6,8 @@ 0 0 - 400 - 300 + 494 + 522 @@ -35,36 +35,36 @@ - - + + Wallet Seed - + false - + Wallet Birthday - + 0 - + @@ -79,6 +79,20 @@ + + + + Number + + + + + + + 10 + + +