Skip to content
Permalink
Browse files

Format files (#1972)

Format files
  • Loading branch information...
nopara73 committed Jul 28, 2019
2 parents 392453b + f014186 commit 0a1a2a5336d53fce6099ba726eb2e68c7b56e3db
@@ -225,7 +225,6 @@ public async Task<IActionResult> PostInputsAsync([FromBody, Required]InputsReque
// Check if mempool would accept a fake transaction created with the registered inputs.
// This will catch ascendant/descendant count and size limits for example.
var result = await RpcClient.TestMempoolAcceptAsync(new[] { new Coin(inputProof.Input.ToOutPoint(), getTxOutResponse.TxOut) });

if (!result.accept)
{
return BadRequest($"Provided input is from an unconfirmed coinjoin, but a limit is reached: {result.rejectReason}");
@@ -25,20 +25,19 @@ public static async Task<bool> ExecuteCommandsAsync(Global global, string[] args
}

OptionSet options = null;
var suite = new CommandSet("wassabee") {
"Usage: wassabee [OPTIONS]+",
"Launches Wasabi Wallet.",
"",
{ "h|help", "Displays help page and exit.",
x => showHelp = x != null},
{ "v|version", "Displays Wasabi version and exit.",
x => showVersion = x != null},
"",
"Available commands are:",
"",
new MixerCommand(daemon),
new PasswordFinderCommand(daemon)
};
var suite = new CommandSet("wassabee")
{
"Usage: wassabee [OPTIONS]+",
"Launches Wasabi Wallet.",
"",
{ "h|help", "Displays help page and exit.", x => showHelp = x != null},
{ "v|version", "Displays Wasabi version and exit.", x => showVersion = x != null},
"",
"Available commands are:",
"",
new MixerCommand(daemon),
new PasswordFinderCommand(daemon)
};

EnsureBackwardCompatibilityWithOldParameters(ref args);
if (await suite.RunAsync(args) == 0)
@@ -18,20 +18,16 @@ public MixerCommand(Daemon daemon)
: base("mix", "Start mixing without the GUI with the specified wallet.")
{
Daemon = daemon;
Options = new OptionSet() {
Options = new OptionSet()
{
"usage: mix --wallet:WalletName --mixall --keepalive",
"",
"Start mixing without the GUI with the specified wallet.",
"eg: ./wassabee mix --wallet:MyWalletName --mixall --keepalive --loglevel:info",

{ "h|help", "Displays help page and exit.",
x => ShowHelp = x != null},
{ "w|wallet=", "The name of the wallet file.",
x => WalletName = x },
{ "mixall", "Mix once even if the coin reached the target anonymity set specified in the config file.",
x => MixAll = x != null},
{ "keepalive", "Do not exit the software after mixing has been finished, rather keep mixing when new money arrives.",
x => KeepMixAlive = x != null},
{ "h|help", "Displays help page and exit.", x => ShowHelp = x != null},
{ "w|wallet=", "The name of the wallet file.", x => WalletName = x },
{ "mixall", "Mix once even if the coin reached the target anonymity set specified in the config file.", x => MixAll = x != null},
{ "keepalive", "Do not exit the software after mixing has been finished, rather keep mixing when new money arrives.", x => KeepMixAlive = x != null},
};
}

@@ -23,24 +23,20 @@ public PasswordFinderCommand(Daemon daemon)
Daemon = daemon;
Language = "en";

Options = new OptionSet() {
Options = new OptionSet()
{
"usage: findpassword --wallet:WalletName --language:lang --numbers:[TRUE|FALSE] --symbold:[TRUE|FALSE]",
"",
"Tries to find typing mistakes in the user password by brute forcing it char by char.",
"eg: ./wassabee findpassword --wallet:MyWalletName --numbers:false --symbold:true",
"",
{ "w|wallet=", "The name of the wallet file.",
x => WalletName = x },
{ "s|secret=", "You can specify an encrypted secret key instead of wallet. Example of encrypted secret: 6PYTMDmkxQrSv8TK4761tuKrV8yFwPyZDqjJafcGEiLBHiqBV6WviFxJV4",
x => EncryptedSecret = Guard.Correct(x) },
{ "l|language=", "The charset to use: en, es, it, fr, pt. Default=en.",
v => Language = v },
{ "n|numbers=", "Try passwords with numbers. Default=true.",
v => UseNumbers = (v=="" || v=="1" || v.ToUpper()=="TRUE") },
{ "x|symbols=", "Try passwords with symbolds. Default=true.",
v => UseSymbols = (v=="" || v=="1" || v.ToUpper()=="TRUE") },
{ "h|help", "Show Help",
v => ShowHelp = true}};
{ "w|wallet=", "The name of the wallet file.", x => WalletName = x },
{ "s|secret=", "You can specify an encrypted secret key instead of wallet. Example of encrypted secret: 6PYTMDmkxQrSv8TK4761tuKrV8yFwPyZDqjJafcGEiLBHiqBV6WviFxJV4", x => EncryptedSecret = Guard.Correct(x) },
{ "l|language=", "The charset to use: en, es, it, fr, pt. Default=en.", v => Language = v },
{ "n|numbers=", "Try passwords with numbers. Default=true.", v => UseNumbers = (v=="" || v=="1" || v.ToUpper()=="TRUE") },
{ "x|symbols=", "Try passwords with symbolds. Default=true.", v => UseSymbols = (v=="" || v=="1" || v.ToUpper()=="TRUE") },
{ "h|help", "Show Help", v => ShowHelp = true}
};
}

public override Task<int> InvokeAsync(IEnumerable<string> args)
@@ -28,18 +28,18 @@ public EditableTextBlock()
{
EditClickTimer = new DispatcherTimer
{
Interval = TimeSpan.FromMilliseconds(500),
Interval = TimeSpan.FromMilliseconds(500)
};

EditClickTimer.Tick += (sender, e) =>
{
EditClickTimer.Stop();

if (IsFocused && !InEditMode)
{
EnterEditMode();
}
};
{
EditClickTimer.Stop();

if (IsFocused && !InEditMode)
{
EnterEditMode();
}
};

this.GetObservable(TextProperty).Subscribe(t =>
{
@@ -168,7 +168,7 @@ private static DrawingPresenter GetPastePresenter()
Geometry = PasteIcon
},
Width = 16,
Height = 16,
Height = 16
};
}

@@ -36,8 +36,10 @@ public class NoparaPasswordBox : ExtendedTextBox, IStyleable
};

private static Key[] SuppressedKeys { get; } =
{ Key.LeftCtrl, Key.RightCtrl, Key.LeftAlt, Key.RightAlt, Key.LeftShift, Key.RightShift, Key.Escape, Key.CapsLock, Key.NumLock, Key.LWin, Key.RWin,
Key.Left,Key.Right,Key.Up,Key.Down };
{
Key.LeftCtrl, Key.RightCtrl, Key.LeftAlt, Key.RightAlt, Key.LeftShift, Key.RightShift, Key.Escape, Key.CapsLock, Key.NumLock, Key.LWin, Key.RWin,
Key.Left, Key.Right, Key.Up, Key.Down
};

private bool _supressChanges;
private string _displayText = "";
@@ -50,6 +50,7 @@ public SortingArrow()
Margin = new Thickness(7, 0),
HorizontalAlignment = HorizontalAlignment.Right
};

TextBox = new TextBlock();

Grid stackPnl = new Grid
@@ -528,7 +528,8 @@ private void Coins_CollectionChanged(object sender, NotifyCollectionChangedEvent
FileName = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "osascript" : "notify-send",
Arguments = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? $"-e \"display notification \\\"Received {amountString} BTC\\\" with title \\\"Wasabi\\\"\"" : $"--expire-time=3000 \"Wasabi\" \"Received {amountString} BTC\"",
CreateNoWindow = true
})) { }
}))
{ }
}
}
}
@@ -117,7 +117,7 @@ public HelpCommands(CommandIconService commandIconService, AvaloniaGlobalCompone
Content = devTools,
DataTemplates =
{
new ViewLocator<Avalonia.Diagnostics.ViewModels.ViewModelBase>(),
new ViewLocator<Avalonia.Diagnostics.ViewModels.ViewModelBase>()
}
};

@@ -94,7 +94,8 @@ private void DoGenerateCommand()
}
}

private static readonly string[] ReservedFileNames = new string[]{
private static readonly string[] ReservedFileNames = new string[]
{
"CON", "PRN", "AUX", "NUL",
"COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
"LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9",
@@ -27,7 +27,8 @@ public ExtPubKeyExplorerTests()
[Fact]
public void ShouldFindNeverUsedKey()
{
var filters = new[] {
var filters = new[]
{
FilterModel.FromHeightlessLine("000000000000de90e633e1b1330859842795d39018d033044e8b003e8cbf58e4:050a2f58828c9820642769ae320a40", 0)
};

@@ -39,7 +40,8 @@ public void ShouldFindNeverUsedKey()
[Fact]
public void ShouldFindUnsedKeyFirstChunk()
{
var filters = new[]{
var filters = new[]
{
CreateFiltersWith(GetScripts(false, 0, 10)),
CreateFiltersWith(GetScripts(false, 10, 10))
};
@@ -52,19 +54,22 @@ public void ShouldFindUnsedKeyFirstChunk()
[Fact]
public void ShouldFindUnsedKeyAtTheEndOfFirstChunk()
{
var filters = new[]{
var filters = new[]
{
CreateFiltersWith(GetScripts(true, 0, 500)),
CreateFiltersWith(GetScripts(true, 500, 499))
};

var unusedKeyIndex = ExtPubKeyExplorer.GetUnusedBech32Keys(1, true, ExtPubKey.GetWif(Network.Main), filters).First().ScriptPubKey.ToCompressedBytes();

Assert.Equal(DerivateScript(true, 999), unusedKeyIndex);
}

[Fact]
public void ShouldFindUnsedKeyAnywhereFirstChunk()
{
var filters = new[]{
var filters = new[]
{
CreateFiltersWith(GetScripts(true, 0, 1)),
CreateFiltersWith(GetScripts(true, 0, 2)),
CreateFiltersWith(GetScripts(true, 0, 27)),
@@ -79,7 +84,8 @@ public void ShouldFindUnsedKeyAnywhereFirstChunk()
[Fact]
public void ShouldFindUnsedKeySecondChunk()
{
var filters = new[]{
var filters = new[]
{
CreateFiltersWith(GetScripts(true, 0, 250)),
CreateFiltersWith(GetScripts(true, 250, 250)),
CreateFiltersWith(GetScripts(true, 500, 250)),
@@ -188,6 +188,7 @@ public void AllFeeEstimateSerialization()
var allFee = new AllFeeEstimate(EstimateSmartFeeMode.Conservative, estimations);
var serialized = JsonConvert.SerializeObject(allFee);
var deserialized = JsonConvert.DeserializeObject<AllFeeEstimate>(serialized);

Assert.Equal(estimations[2], deserialized.Estimations[2]);
Assert.Equal(estimations[3], deserialized.Estimations[3]);
Assert.Equal(estimations[19], deserialized.Estimations[19]);
@@ -202,9 +203,9 @@ public void InputsResponseSerialization()
UniqueId = Guid.NewGuid(),
RoundId = 1,
};

var serialized = JsonConvert.SerializeObject(resp);
var deserialized = JsonConvert.DeserializeObject<InputsResponse>(serialized);

Assert.Equal(resp.RoundId, deserialized.RoundId);
Assert.Equal(resp.UniqueId, deserialized.UniqueId);
}
@@ -311,7 +312,8 @@ private void Set_CollectionChanged(object sender, NotifyCollectionChangedEventAr
Assert.Null(e.OldItems); // "Reset action must be initialized with no changed items."
break;
}
default: throw new NotSupportedException();
default:
throw new NotSupportedException();
}
}
}

0 comments on commit 0a1a2a5

Please sign in to comment.
You can’t perform that action at this time.