Skip to content

Commit

Permalink
remove round up sysfee (#219)
Browse files Browse the repository at this point in the history
Co-authored-by: Vitor Nazário Coelho <vncoelho@gmail.com>
  • Loading branch information
bettybao1209 and vncoelho committed Apr 13, 2020
1 parent 12dcef0 commit f451ca8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
9 changes: 0 additions & 9 deletions src/RpcClient/TransactionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SignItem>();
Expand Down
1 change: 0 additions & 1 deletion tests/Neo.Network.RPC.Tests/UT_TransactionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit f451ca8

Please sign in to comment.