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

Commit

Permalink
Oracle: Show version in pool (#570)
Browse files Browse the repository at this point in the history
* Show version in pool

* UpdateChnages

* adapt Dockerfile to recent code changes (#536) (#567)

* Move syscall to native contract

* Start oracle

* Allow start Oracle

* Oracle test

* Show version in pool

* UpdateChnages

* Move syscall to native contract

Co-authored-by: Guil. Sperb Machado <gsm@machados.org>
  • Loading branch information
shargon and gsmachado committed Apr 18, 2020
1 parent 0879ef6 commit 750a2e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS Build

COPY neo-cli /neo-cli
COPY Neo.ConsoleService /Neo.ConsoleService
COPY NuGet.Config /neo-cli

WORKDIR /neo-cli
Expand Down
4 changes: 2 additions & 2 deletions neo-cli/CLI/MainService.Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ private void OnShowPoolCommand(bool verbose = false)
out IEnumerable<Transaction> unverifiedTransactions);
Console.WriteLine("Verified Transactions:");
foreach (Transaction tx in verifiedTransactions)
Console.WriteLine($" {tx.Hash} {tx.GetType().Name} {tx.NetworkFee} GAS_NetFee");
Console.WriteLine($" {tx.Hash} {tx.Version.ToString()} {tx.NetworkFee} NetFee");
Console.WriteLine("Unverified Transactions:");
foreach (Transaction tx in unverifiedTransactions)
Console.WriteLine($" {tx.Hash} {tx.GetType().Name} {tx.NetworkFee} GAS_NetFee");
Console.WriteLine($" {tx.Hash} {tx.Version.ToString()} {tx.NetworkFee} NetFee");
}
Console.WriteLine($"total: {Blockchain.Singleton.MemPool.Count}, verified: {Blockchain.Singleton.MemPool.VerifiedCount}, unverified: {Blockchain.Singleton.MemPool.UnVerifiedCount}");
}
Expand Down
9 changes: 5 additions & 4 deletions neo-cli/CLI/MainService.Oracle.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Neo.ConsoleService;
using Neo.Oracle;
using Neo.SmartContract;
using Neo.SmartContract.Native;
using Neo.VM;
using System;

Expand Down Expand Up @@ -31,17 +33,16 @@ private void ApplicationEngine_Log(object sender, LogEventArgs e)
/// Process "oracle test" command
/// </summary>
[ConsoleCommand("oracle test", Category = "Oracle Commands")]
private void OnOracleTest(string url)
private void OnOracleTest(string url, OracleWalletBehaviour type = OracleWalletBehaviour.OracleWithoutAssert)
{
if (NoWallet()) return;

using ScriptBuilder script = new ScriptBuilder();

script.EmitSysCall(InteropService.Oracle.Neo_Oracle_Get, url, null, null);
script.EmitAppCall(NativeContract.Oracle.Hash, "get", url, null, null, null);
script.EmitSysCall(InteropService.Runtime.Log);

var tx = CurrentWallet.MakeTransaction(script.ToArray(), sender: null, attributes: null, cosigners: null,
oracle: Oracle.OracleWalletBehaviour.OracleWithoutAssert);
var tx = CurrentWallet.MakeTransaction(script.ToArray(), sender: null, attributes: null, cosigners: null, oracle: type);

SignAndSendTx(tx);
}
Expand Down

0 comments on commit 750a2e1

Please sign in to comment.