Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Allow to skip verification (#534)
Browse files Browse the repository at this point in the history
* Allow to skip verification

* Update neo-cli.csproj

* Fix GUI
  • Loading branch information
shargon authored Jan 21, 2020
1 parent 51cd29f commit a477dc6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
11 changes: 10 additions & 1 deletion neo-cli/CLI/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1370,9 +1370,14 @@ public void OpenWallet(string path, string password)
public async void Start(string[] args)
{
if (NeoSystem != null) return;
bool verifyImport = true;
for (int i = 0; i < args.Length; i++)
switch (args[i])
{
case "/noverify":
case "--noverify":
verifyImport = false;
break;
case "/testnet":
case "--testnet":
case "-t":
Expand All @@ -1398,7 +1403,11 @@ public async void Start(string[] args)
blocksToImport.Add(blocksBeingImported.Current);
}
if (blocksToImport.Count == 0) break;
await NeoSystem.Blockchain.Ask<Blockchain.ImportCompleted>(new Blockchain.Import { Blocks = blocksToImport });
await NeoSystem.Blockchain.Ask<Blockchain.ImportCompleted>(new Blockchain.Import
{
Blocks = blocksToImport,
Verify = verifyImport
});
if (NeoSystem is null) return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion neo-cli/neo-cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Neo" Version="3.0.0-CI00844" />
<PackageReference Include="Neo" Version="3.0.0-CI00853" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="4.6.0" />
</ItemGroup>

Expand Down
10 changes: 7 additions & 3 deletions neo-gui/GUI/Wrappers/UIntBaseConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul
{
if (destinationType != typeof(string))
throw new NotSupportedException();
UIntBase i = value as UIntBase;
if (i == null) return null;
return i.ToString();

return value switch
{
UInt160 i => i.ToString(),
UInt256 i => i.ToString(),
_ => null,
};
}
}
}

0 comments on commit a477dc6

Please sign in to comment.