Skip to content

Commit

Permalink
Remove GetValue<T>() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
greymistcube committed Nov 10, 2023
1 parent cdbd6ea commit 5591cf2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .Lib9c.Tests/Model/State/LazyStateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void Serialize()
_unloaded.State.Foo = 456L;
Assert.Equal(
456L,
(long)((Dictionary)_unloaded.Serialize()).GetValue<Integer>("foo")
(long)(Integer)((Dictionary)_unloaded.Serialize())["foo"]
);
Assert.True(_unloaded.GetStateOrSerializedEncoding(out _, out _));
}
Expand Down Expand Up @@ -107,8 +107,8 @@ public SampleState(Address address, long foo, string bar)
public SampleState(Dictionary serialized)
: base(serialized)
{
Foo = serialized.GetValue<Integer>("foo");
Bar = serialized.GetValue<Text>("bar");
Foo = (Integer)serialized["foo"];
Bar = (Text)serialized["bar"];
}

public SampleState(IValue iValue)
Expand Down
4 changes: 2 additions & 2 deletions Lib9c/Action/ValidatorSetOperate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ private Validator BackwardCompatibility(Bencodex.Types.Dictionary dict)
catch (Exception)
{
BigInteger power =
new BigInteger(dict.GetValue<Binary>(PowerKey).ToByteArray());
new BigInteger(((Binary)dict[PowerKey]).ByteArray);

Check failure on line 166 in Lib9c/Action/ValidatorSetOperate.cs

View workflow job for this annotation

GitHub Actions / build-for-unity

Argument 1: cannot convert from 'System.Collections.Immutable.ImmutableArray<byte>' to 'byte[]'

Check failure on line 166 in Lib9c/Action/ValidatorSetOperate.cs

View workflow job for this annotation

GitHub Actions / build-for-unity

Argument 1: cannot convert from 'System.Collections.Immutable.ImmutableArray<byte>' to 'byte[]'

Check failure on line 166 in Lib9c/Action/ValidatorSetOperate.cs

View workflow job for this annotation

GitHub Actions / build-and-test (Release)

Argument 1: cannot convert from 'System.Collections.Immutable.ImmutableArray<byte>' to 'byte[]'

Check failure on line 166 in Lib9c/Action/ValidatorSetOperate.cs

View workflow job for this annotation

GitHub Actions / build-and-test (Release)

Argument 1: cannot convert from 'System.Collections.Immutable.ImmutableArray<byte>' to 'byte[]'
PublicKey publicKey =
new PublicKey(dict.GetValue<Binary>(PublicKeyKey).ToByteArray());
new PublicKey(((Binary)dict[PublicKeyKey]).ByteArray);

return new Validator(publicKey, power);
}
Expand Down
2 changes: 1 addition & 1 deletion Lib9c/Model/Coupons/Coupon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Coupon(IValue serialized)
);
}

Id = new Guid(dict.GetValue<Binary>("id"));
Id = new Guid((Binary)dict["id"]);
Rewards = new RewardSet((Bencodex.Types.Dictionary)dict["rewards"]);
}

Expand Down

0 comments on commit 5591cf2

Please sign in to comment.