private void ConfirmSeed() { try { ConfirmSeedCommand.Executable = false; var decodedSeed = WalletSeed.DecodeAndValidateUserInput(Input, _pgpWordList); if (ValueArray.ShallowEquals(_seed, decodedSeed)) { _wizard.CurrentDialog = new PromptPassphrasesDialog(Wizard, _seed); } else { MessageBox.Show("Seed does not match"); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Invalid seed"); } finally { ConfirmSeedCommand.Executable = true; } }
public CreateOrImportSeedDialog(StartupWizard wizard) : base(wizard) { _randomSeed = WalletSeed.GenerateRandomSeed(); ContinueCommand = new DelegateCommand(Continue); ContinueCommand.Executable = false; }
private void Continue() { try { ContinueCommand.Executable = false; if (CreateChecked) { Wizard.CurrentDialog = new ConfirmSeedBackupDialog(Wizard, this, _randomSeed, _pgpWordList); } else { var seed = WalletSeed.DecodeAndValidateUserInput(ImportedSeed, _pgpWordList); Wizard.CurrentDialog = new PromptPassphrasesDialog(Wizard, seed); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } finally { ContinueCommand.Executable = true; } }
private void ConfirmSeed() { try { ConfirmSeedCommand.Executable = false; // When on testnet, allow clicking through the dialog without any validation. if (App.Current.ActiveNetwork == BlockChainIdentity.TestNet) { if (Input.Length == 0) { _wizard.CurrentDialog = new PromptPassphrasesDialog(Wizard, _seed); return; } } var decodedSeed = WalletSeed.DecodeAndValidateUserInput(Input, _pgpWordList); if (ValueArray.ShallowEquals(_seed, decodedSeed)) { _wizard.CurrentDialog = new PromptPassphrasesDialog(Wizard, _seed); } else { MessageBox.Show("Seed does not match"); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Invalid seed"); } finally { ConfirmSeedCommand.Executable = true; } }
protected override void OnModelCreating(ModelBuilder modelBuilder) { WalletTable.Configure(modelBuilder); WalletSeed.Configure(modelBuilder); WalletGroupTable.Configure(modelBuilder); WalletGroupSeed.Configure(modelBuilder); WalletGroupItemTable.Configure(modelBuilder); WalletGroupItemSeed.Configure(modelBuilder); }
private void Continue() { try { ContinueCommand.Executable = false; var seed = WalletSeed.DecodeAndValidateUserInput(ImportedSeed, _pgpWordList); Wizard.CurrentDialog = new PromptPassphrasesDialog(Wizard, seed, true); } catch (Exception ex) { MessageBox.Show(ex.Message, "Invalid seed"); } finally { ContinueCommand.Executable = true; } }
// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddMvc(); var location = System.Reflection.Assembly.GetEntryAssembly().Location; var directory = System.IO.Path.GetDirectoryName(location); var walletConfig = WalletConfig.Default(); walletConfig.CheckNodeApiHttpAddr = "http://localhost:13413"; walletConfig.DataFileDir = directory; var walletSeed = WalletSeed.from_file(walletConfig); var keychain = walletSeed.derive_keychain("password"); services.AddSingleton(pr => walletConfig); services.AddSingleton(pr => keychain); services.AddSingleton(pr => new CoinbaseHandler(walletConfig, keychain)); services.AddSingleton(pr => new WalletReceiver(walletConfig, keychain)); }
public static void NegativeDecodeAndValidateUserInputTest(string pgpSeed, Type exception) { Assert.Throws(exception, () => WalletSeed.DecodeAndValidateUserInput(pgpSeed, PgpWordList)); }