Skip to content

Commit

Permalink
Fix test : JArray[uint] solve to JArray[object] instead of JArray[int…
Browse files Browse the repository at this point in the history
…] which caused an ArgumentException
  • Loading branch information
NicolasDorier committed Nov 7, 2014
1 parent daad062 commit 2e6e258
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions NBitcoin/OpenAsset/CoinprismColoredTransactionRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ public ColoredTransaction Get(uint256 txId)
var inputs = json["inputs"] as JArray;
if(inputs != null)
{
for(uint i = 0 ; i < inputs.Count ; i++)
for(int i = 0 ; i < inputs.Count ; i++)
{
if(inputs[i]["asset_address"].Value<string>() == null)
continue;
var entry = new ColoredEntry();
entry.Index = i;
entry.Index = (uint)i;
entry.Asset = new Asset(
new AssetId((ScriptId)new BitcoinScriptAddress(inputs[i]["asset_address"].ToString(), null).ID),
inputs[i]["asset_quantity"].Value<ulong>());
Expand All @@ -86,7 +86,7 @@ public ColoredTransaction Get(uint256 txId)
if(outputs != null)
{
bool issuance = true;
for(uint i = 0 ; i < outputs.Count ; i++)
for(int i = 0 ; i < outputs.Count ; i++)
{
var marker = ColorMarker.TryParse(new Script(Encoders.Hex.DecodeData(outputs[i]["script"].ToString())));
if(marker != null)
Expand All @@ -98,7 +98,7 @@ public ColoredTransaction Get(uint256 txId)
if(outputs[i]["asset_address"].Value<string>() == null)
continue;
ColoredEntry entry = new ColoredEntry();
entry.Index = i;
entry.Index = (uint)i;
entry.Asset = new Asset(
new AssetId((ScriptId)new BitcoinScriptAddress(outputs[i]["asset_address"].ToString(), null).ID),
outputs[i]["asset_quantity"].Value<ulong>()
Expand Down

0 comments on commit 2e6e258

Please sign in to comment.