From f451ca8d96ca7ace6c9b2b75cc1e992c8b255e16 Mon Sep 17 00:00:00 2001 From: cn1010 Date: Tue, 14 Apr 2020 00:16:40 +0800 Subject: [PATCH] remove round up sysfee (#219) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vitor Nazário Coelho --- src/RpcClient/TransactionManager.cs | 9 --------- tests/Neo.Network.RPC.Tests/UT_TransactionManager.cs | 1 - 2 files changed, 10 deletions(-) diff --git a/src/RpcClient/TransactionManager.cs b/src/RpcClient/TransactionManager.cs index 43d182c8b..1ce09d6d9 100644 --- a/src/RpcClient/TransactionManager.cs +++ b/src/RpcClient/TransactionManager.cs @@ -78,15 +78,6 @@ public TransactionManager MakeTransaction(byte[] script, TransactionAttribute[] UInt160[] hashes = Tx.GetScriptHashesForVerifying(null); RpcInvokeResult result = rpcClient.InvokeScript(script, hashes); Tx.SystemFee = Math.Max(long.Parse(result.GasConsumed) - ApplicationEngine.GasFree, 0); - if (Tx.SystemFee > 0) - { - long d = (long)NativeContract.GAS.Factor; - long remainder = Tx.SystemFee % d; - if (remainder > 0) - Tx.SystemFee += d - remainder; - else if (remainder < 0) - Tx.SystemFee -= remainder; - } context = new ContractParametersContext(Tx); signStore = new List(); diff --git a/tests/Neo.Network.RPC.Tests/UT_TransactionManager.cs b/tests/Neo.Network.RPC.Tests/UT_TransactionManager.cs index b48c71519..722c1bb04 100644 --- a/tests/Neo.Network.RPC.Tests/UT_TransactionManager.cs +++ b/tests/Neo.Network.RPC.Tests/UT_TransactionManager.cs @@ -94,7 +94,6 @@ public void TestMakeTransaction() var tx = txManager.Tx; Assert.AreEqual("53616d706c6555726c", tx.Attributes[0].Data.ToHexString()); - Assert.AreEqual(1, tx.SystemFee / (long)NativeContract.GAS.Factor); } [TestMethod]