mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Do not ask for address confirmation if a new wallet is generated
This commit is contained in:
@@ -138,8 +138,6 @@ namespace BTCPayServer.Tests
|
|||||||
{
|
{
|
||||||
seed = Driver.FindElements(By.ClassName("alert-success")).First().FindElement(By.TagName("code")).Text;
|
seed = Driver.FindElements(By.ClassName("alert-success")).First().FindElement(By.TagName("code")).Text;
|
||||||
}
|
}
|
||||||
Driver.FindElement(By.Id("Confirm")).ForceClick();
|
|
||||||
AssertHappyMessage();
|
|
||||||
return new Mnemonic(seed);
|
return new Mnemonic(seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ namespace BTCPayServer.Controllers
|
|||||||
Severity = StatusMessageModel.StatusSeverity.Error,
|
Severity = StatusMessageModel.StatusSeverity.Error,
|
||||||
Html = "There was an error generating your wallet. Is your node available?"
|
Html = "There was an error generating your wallet. Is your node available?"
|
||||||
});
|
});
|
||||||
return RedirectToAction("AddDerivationScheme", new {storeId, cryptoCode});
|
return RedirectToAction(nameof(AddDerivationScheme), new {storeId, cryptoCode});
|
||||||
}
|
}
|
||||||
|
|
||||||
Logs.Events.LogInformation($"GenerateNBXWallet after GenerateWalletAsync");
|
Logs.Events.LogInformation($"GenerateNBXWallet after GenerateWalletAsync");
|
||||||
@@ -359,7 +359,7 @@ namespace BTCPayServer.Controllers
|
|||||||
var result = await AddDerivationScheme(storeId,
|
var result = await AddDerivationScheme(storeId,
|
||||||
new DerivationSchemeViewModel()
|
new DerivationSchemeViewModel()
|
||||||
{
|
{
|
||||||
Confirmation = false,
|
Confirmation = string.IsNullOrEmpty(request.ExistingMnemonic),
|
||||||
Network = network,
|
Network = network,
|
||||||
RootFingerprint = response.AccountKeyPath.MasterFingerprint.ToString(),
|
RootFingerprint = response.AccountKeyPath.MasterFingerprint.ToString(),
|
||||||
RootKeyPath = network.GetRootKeyPath(),
|
RootKeyPath = network.GetRootKeyPath(),
|
||||||
@@ -372,15 +372,25 @@ namespace BTCPayServer.Controllers
|
|||||||
Enabled = !store.GetStoreBlob()
|
Enabled = !store.GetStoreBlob()
|
||||||
.IsExcluded(new PaymentMethodId(cryptoCode, PaymentTypes.BTCLike))
|
.IsExcluded(new PaymentMethodId(cryptoCode, PaymentTypes.BTCLike))
|
||||||
}, cryptoCode);
|
}, cryptoCode);
|
||||||
|
if (!ModelState.IsValid || !(result is RedirectToActionResult))
|
||||||
TempData.SetStatusMessageModel(new StatusMessageModel()
|
return result;
|
||||||
|
TempData.Clear();
|
||||||
|
if (string.IsNullOrEmpty(request.ExistingMnemonic))
|
||||||
{
|
{
|
||||||
Severity = StatusMessageModel.StatusSeverity.Success,
|
TempData.SetStatusMessageModel(new StatusMessageModel()
|
||||||
Html = !string.IsNullOrEmpty(request.ExistingMnemonic)
|
{
|
||||||
? "Your wallet has been imported."
|
Severity = StatusMessageModel.StatusSeverity.Success,
|
||||||
: $"Your wallet has been generated. Please store your seed securely! <br/><code>{response.Mnemonic}</code>"
|
Html = $"Your wallet has been generated. Please store your seed securely! <br/><code>{response.Mnemonic}</code>"
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TempData.SetStatusMessageModel(new StatusMessageModel()
|
||||||
|
{
|
||||||
|
Severity = StatusMessageModel.StatusSeverity.Warning,
|
||||||
|
Html = "Please check your addresses and confirm"
|
||||||
|
});
|
||||||
|
}
|
||||||
Logs.Events.LogInformation($"GenerateNBXWallet returning success result");
|
Logs.Events.LogInformation($"GenerateNBXWallet returning success result");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user