Skip to content

Commit

Permalink
Merge pull request #1 from neo-project/master
Browse files Browse the repository at this point in the history
Sync to Neo 3.0.0-CI01148 (neo-project#709)
  • Loading branch information
chenzhitong authored Jan 13, 2021
2 parents 3acb8aa + 5f42af3 commit 9374ada
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 38 deletions.
18 changes: 0 additions & 18 deletions neo-cli/CLI/MainService.Consensus.cs

This file was deleted.

6 changes: 3 additions & 3 deletions neo-cli/CLI/MainService.Vote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void OnRegisterCandidateCommand(UInt160 account)
byte[] script;
using (ScriptBuilder scriptBuilder = new ScriptBuilder())
{
scriptBuilder.EmitDynamicCall(NativeContract.NEO.Hash, "registerCandidate", true, publicKey);
scriptBuilder.EmitDynamicCall(NativeContract.NEO.Hash, "registerCandidate", publicKey);
script = scriptBuilder.ToArray();
}

Expand Down Expand Up @@ -83,7 +83,7 @@ private void OnUnregisterCandidateCommand(UInt160 account)
byte[] script;
using (ScriptBuilder scriptBuilder = new ScriptBuilder())
{
scriptBuilder.EmitDynamicCall(NativeContract.NEO.Hash, "unregisterCandidate", true, publicKey);
scriptBuilder.EmitDynamicCall(NativeContract.NEO.Hash, "unregisterCandidate", publicKey);
script = scriptBuilder.ToArray();
}

Expand All @@ -107,7 +107,7 @@ private void OnVoteCommand(UInt160 senderAccount, ECPoint publicKey)
byte[] script;
using (ScriptBuilder scriptBuilder = new ScriptBuilder())
{
scriptBuilder.EmitDynamicCall(NativeContract.NEO.Hash, "vote", true, senderAccount, publicKey);
scriptBuilder.EmitDynamicCall(NativeContract.NEO.Hash, "vote", senderAccount, publicKey);
script = scriptBuilder.ToArray();
}

Expand Down
13 changes: 2 additions & 11 deletions neo-cli/CLI/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ private byte[] LoadDeploymentScript(string nefFilePath, string manifestFilePath,

using (ScriptBuilder sb = new ScriptBuilder())
{
sb.EmitDynamicCall(NativeContract.ContractManagement.Hash, "deploy", true, nef.ToArray(), manifest.ToJson().ToString());
sb.EmitDynamicCall(NativeContract.ContractManagement.Hash, "deploy", nef.ToArray(), manifest.ToJson().ToString());
return sb.ToArray();
}
}
Expand Down Expand Up @@ -391,10 +391,6 @@ public async void Start(string[] args)
{
Console.WriteLine($"Failed to open file \"{Settings.Default.UnlockWallet.Path}\"");
}
if (Settings.Default.UnlockWallet.StartConsensus && CurrentWallet != null)
{
OnStartConsensusCommand();
}
}
}

Expand Down Expand Up @@ -525,7 +521,6 @@ private bool OnInvokeWithResult(UInt160 scriptHash, string operation, out StackI
}
}

bool hasReturnValue;
var snapshot = Blockchain.Singleton.GetSnapshot();
ContractState contract = NativeContract.ContractManagement.GetContract(snapshot, scriptHash);
if (contract == null)
Expand All @@ -542,17 +537,13 @@ private bool OnInvokeWithResult(UInt160 scriptHash, string operation, out StackI
result = StackItem.Null;
return false;
}
else
{
hasReturnValue = contract.Manifest.Abi.GetMethod(operation).ReturnType != ContractParameterType.Void;
}
}

byte[] script;

using (ScriptBuilder scriptBuilder = new ScriptBuilder())
{
scriptBuilder.EmitDynamicCall(scriptHash, operation, hasReturnValue, parameters.ToArray());
scriptBuilder.EmitDynamicCall(scriptHash, operation, parameters.ToArray());
script = scriptBuilder.ToArray();
Console.WriteLine($"Invoking script with: '{script.ToBase64String()}'");
}
Expand Down
2 changes: 0 additions & 2 deletions neo-cli/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public class UnlockWalletSettings
{
public string Path { get; }
public string Password { get; }
public bool StartConsensus { get; }
public bool IsActive { get; }

public UnlockWalletSettings(IConfigurationSection section)
Expand All @@ -105,7 +104,6 @@ public UnlockWalletSettings(IConfigurationSection section)
{
this.Path = section.GetValue("Path", "");
this.Password = section.GetValue("Password", "");
this.StartConsensus = bool.Parse(section.GetValue("StartConsensus", "false"));
this.IsActive = bool.Parse(section.GetValue("IsActive", "false"));
}
}
Expand Down
1 change: 0 additions & 1 deletion neo-cli/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"UnlockWallet": {
"Path": "",
"Password": "",
"StartConsensus": false,
"IsActive": false
},
"PluginURL": "https://github.com/neo-project/neo-modules/releases/download/v{1}/{0}.zip"
Expand Down
1 change: 0 additions & 1 deletion neo-cli/config.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"UnlockWallet": {
"Path": "",
"Password": "",
"StartConsensus": false,
"IsActive": false
},
"PluginURL": "https://github.com/neo-project/neo-modules/releases/download/v{1}/{0}.zip"
Expand Down
1 change: 0 additions & 1 deletion neo-cli/config.testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"UnlockWallet": {
"Path": "",
"Password": "",
"StartConsensus": false,
"IsActive": false
},
"PluginURL": "https://github.com/neo-project/neo-modules/releases/download/v{1}/{0}.zip"
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-CI01133" />
<PackageReference Include="Neo" Version="3.0.0-CI01148" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 9374ada

Please sign in to comment.