AlexanderBuzz / xrpl-php

A PHP library to interact with the XRP Ledger (XRPL) blockchain
ISC License
5 stars 3 forks source link

Bug - rounding when calculating getFeeXrp #14

Closed zgrguric closed 1 year ago

zgrguric commented 1 year ago
[2023-06-29 00:55:03] production.ERROR: Rounding is necessary to represent the result of the operation at this scale. {"exception":"[object] (Brick\\Math\\Exception\\RoundingNecessaryException(code: 0): Rounding is necessary to represent the result of the operation at this scale. at /opt/nginx-1.15.8/htdocs/app/vendor/brick/math/src/Exception/RoundingNecessaryException.php:17)
[stacktrace]
#0 /opt/nginx-1.15.8/htdocs/app/vendor/brick/math/src/Internal/Calculator.php(459): Brick\\Math\\Exception\\RoundingNecessaryException::roundingNecessary()
#1 /opt/nginx-1.15.8/htdocs/app/vendor/brick/math/src/BigDecimal.php(252): Brick\\Math\\Internal\\Calculator->divRound('6114796875000', '1000000000', 0)
#2 /opt/nginx-1.15.8/htdocs/app/vendor/brick/math/src/BigDecimal.php(640): Brick\\Math\\BigDecimal->dividedBy(Object(Brick\\Math\\BigDecimal), 6, 0)
#3 /opt/nginx-1.15.8/htdocs/app/vendor/hardcastle/xrpl_php/src/Sugar/getFeeXrp.php(41): Brick\\Math\\BigDecimal->toScale(6)
#4 /opt/nginx-1.15.8/htdocs/app/vendor/hardcastle/xrpl_php/src/Sugar/autofill.php(113): XRPL_PHP\\Sugar\\getFeeXrp(Object(XRPL_PHP\\Client\\JsonRpcClient))
#5 /opt/nginx-1.15.8/htdocs/app/vendor/hardcastle/xrpl_php/src/Sugar/autofill.php(188): XRPL_PHP\\Sugar\\calculateFeePerTransactionType(Object(XRPL_PHP\\Client\\JsonRpcClient), Array, NULL)
#6 /opt/nginx-1.15.8/htdocs/app/vendor/hardcastle/xrpl_php/src/Client/JsonRpcClient.php(228): XRPL_PHP\\Sugar\\autofill(Object(XRPL_PHP\\Client\\JsonRpcClient), Array)
#7 /opt/nginx-1.15.8/htdocs/app/app/Console/Commands/ProcessEscrow.php(227): XRPL_PHP\\Client\\JsonRpcClient->autofill(Array)
AlexanderBuzz commented 1 year ago

Fixed + bugfix release 0.7.3