public void Test_fixed(AbiEncodingStyle encodingStyle) { AbiFixed type = AbiType.Fixed; BigRational data = BigRational.FromBigInt(123456789) * BigRational.Reciprocal(BigRational.Pow(BigRational.FromInt(10), type.Precision)); AbiSignature signature = new AbiSignature("abc", type); byte[] encoded = _abiEncoder.Encode(encodingStyle, signature, data); object[] arguments = _abiEncoder.Decode(encodingStyle, signature, encoded); Assert.AreEqual(arguments[0], data); }
public void Test_fixed_exception(int length, int precision) { Assert.Throws <ArgumentException>(() => _ = new AbiFixed(length, precision)); }