Skip to content

Commit

Permalink
Remove empty string circumventions (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
KingGorrin committed Sep 18, 2023
1 parent 4371152 commit ea7eca6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/ZenonCli/Commands/Bridge.Admin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ protected override async Task ProcessAsync()
await AssertBridgeAdminAsync();

WriteInfo("Halting the bridge ...");
// Use signature value '1' to circumvent the empty string unpack issue.
await ZnnClient.Send(ZnnClient.Embedded.Bridge.Halt("1"));
await ZnnClient!.Send(ZnnClient!.Embedded.Bridge.Halt(""));
WriteInfo("Done");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ZenonCli/Commands/CommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ protected BigInteger ParseAmount(string value, long decimals, string argumentNam
{
try
{
return AmountUtils.ExtractDecimals(double.Parse(value, NumberStyles.Any, CultureInfo.InvariantCulture), (int)decimals);
return AmountUtils.ExtractDecimals(value, (int)decimals);
}
catch (Exception e)
{
Expand Down
8 changes: 2 additions & 6 deletions src/ZenonCli/Commands/Orchestrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ protected override async Task ProcessAsync()
WriteInfo("Changing public key...");
}

// Use signature value '1' to circumvent the empty string unpack issue.
await ZnnClient.Send(ZnnClient.Embedded.Bridge.ChangeTssECDSAPubKey(this.PubKey, "1", "1"));
await ZnnClient!.Send(ZnnClient!.Embedded.Bridge.ChangeTssECDSAPubKey(this.PubKey, "", ""));
WriteInfo("Done");
}
}
Expand All @@ -78,11 +77,8 @@ protected override async Task ProcessAsync()
await AssertBridgeAdminAsync();
}

// Use signature value '1' to circumvent the empty string unpack issue.
var signature = Signature ?? "1";

WriteInfo("Halting bridge operations ...");
await ZnnClient.Send(ZnnClient.Embedded.Bridge.Halt(signature));
await ZnnClient!.Send(ZnnClient!.Embedded.Bridge.Halt(Signature));
WriteInfo("Done");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ZenonCli/ZenonCli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Cryptography.ECDSA.Secp256k1" Version="1.1.3" />
<PackageReference Include="Zenon.Sdk" Version="0.6.4" />
<PackageReference Include="Zenon.Sdk" Version="0.6.6" />
</ItemGroup>

</Project>

0 comments on commit ea7eca6

Please sign in to comment.