Skip to content

Commit

Permalink
Fixes Transaction.ToJson() (neo-project#1071)
Browse files Browse the repository at this point in the history
* Fixes `Transaction.ToJson()`

* Fix tests
  • Loading branch information
erikzhang authored and Tommo-L committed Jun 22, 2020
1 parent f06f26c commit bc25b7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion neo.UnitTests/Network/P2P/Payloads/UT_Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ public void ToJson()
((JArray)jObj["cosigners"]).Count.Should().Be(0);
jObj["net_fee"].AsString().Should().Be("0");
jObj["script"].AsString().Should().Be("4220202020202020202020202020202020202020202020202020202020202020");
jObj["sys_fee"].AsNumber().Should().Be(42);
jObj["sys_fee"].AsString().Should().Be("4200000000");
}
}
}
4 changes: 2 additions & 2 deletions neo/Network/P2P/Payloads/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ public JObject ToJson()
json["version"] = Version;
json["nonce"] = Nonce;
json["sender"] = Sender.ToAddress();
json["sys_fee"] = new BigDecimal(SystemFee, NativeContract.GAS.Decimals).ToString();
json["net_fee"] = new BigDecimal(NetworkFee, NativeContract.GAS.Decimals).ToString();
json["sys_fee"] = SystemFee.ToString();
json["net_fee"] = NetworkFee.ToString();
json["valid_until_block"] = ValidUntilBlock;
json["attributes"] = Attributes.Select(p => p.ToJson()).ToArray();
json["cosigners"] = Cosigners.Select(p => p.ToJson()).ToArray();
Expand Down

0 comments on commit bc25b7b

Please sign in to comment.