stoway / TronNet

.net sdk of tron
MIT License
69 stars 43 forks source link

When query contract balance, got error: Value was either too large or too small for an Int64. #17

Closed wizd closed 3 years ago

wizd commented 3 years ago

[ERR] Value was either too large or too small for an Int64. System.OverflowException: Value was either too large or too small for an Int64. at System.Numerics.BigInteger.op_Explicit(BigInteger value) at TronNet.ABI.Decoders.IntTypeDecoder.DecodeLong(Byte[] encoded) at TronNet.ABI.Decoders.IntTypeDecoder.Decode(Byte[] encoded, Type type) at TronNet.ABI.FunctionEncoding.ParameterDecoder.DecodeOutput(Byte[] outputBytes, ParameterOutput[] outputParameters) at TronNet.ABI.FunctionEncoding.ParameterDecoder.DecodeAttributes(Byte[] output, Object result, PropertyInfo[] properties) at TronNet.ABI.FunctionEncoding.ParameterDecoder.DecodeAttributes(String output, Object result, PropertyInfo[] properties) at TronNet.ABI.FunctionEncoding.ParameterDecoder.DecodeAttributes[T](String output, T result, PropertyInfo[] properties) at TronNet.ABI.FunctionEncoding.FunctionCallDecoder.DecodeFunctionOutput[T](T functionOutputResult, String output) at TronNet.ABI.FunctionEncoding.FunctionCallDecoder.DecodeFunctionOutput[T](String output) at TronNet.Contracts.TRC20ContractClient.BalanceOfAsync(String contractAddress, ITronAccount ownerAccount)

wizd commented 3 years ago

found a solution. several contract api uses long as balance/amount. should change to BigInteger.