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

sync ondeploycommand #722

Merged
merged 3 commits into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions neo-cli/CLI/MainService.Contracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ partial class MainService
private void OnDeployCommand(string filePath, string manifestPath = null)
{
if (NoWallet()) return;
byte[] script = LoadDeploymentScript(filePath, manifestPath, out var nef);
byte[] script = LoadDeploymentScript(filePath, manifestPath, out var nef, out var manifest);

Transaction tx;
try
Expand All @@ -31,7 +31,7 @@ private void OnDeployCommand(string filePath, string manifestPath = null)
return;
}

UInt160 hash = SmartContract.Helper.GetContractHash(tx.Sender, nef.Script);
UInt160 hash = SmartContract.Helper.GetContractHash(tx.Sender, nef.CheckSum, manifest.Name);

Console.WriteLine($"Contract hash: {hash}");
Console.WriteLine($"Gas: {new BigDecimal(tx.SystemFee, NativeContract.GAS.Decimals)}");
Expand Down
4 changes: 2 additions & 2 deletions neo-cli/CLI/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private bool NoWallet()
return true;
}

private byte[] LoadDeploymentScript(string nefFilePath, string manifestFilePath, out NefFile nef)
private byte[] LoadDeploymentScript(string nefFilePath, string manifestFilePath, out NefFile nef, out ContractManifest manifest)
{
if (string.IsNullOrEmpty(manifestFilePath))
{
Expand All @@ -253,7 +253,7 @@ private byte[] LoadDeploymentScript(string nefFilePath, string manifestFilePath,
throw new ArgumentException(nameof(manifestFilePath));
}

var manifest = ContractManifest.Parse(File.ReadAllBytes(manifestFilePath));
manifest = ContractManifest.Parse(File.ReadAllBytes(manifestFilePath));

// Read nef

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-CI01161" />
<PackageReference Include="Neo" Version="3.0.0-CI01167" />
</ItemGroup>

<ItemGroup>
Expand Down