realJayNay/ost-kit-php-client

validation is failed in airdrop API

Closed this issue · 2 comments

validation is failed in airdrop API. zero (hard coded value) is passed to validateAmount API which triggered the below error.

aridrop():
self::validateAmount($amount, 0, $this->token['total_supply']);

Fatal error: Uncaught InvalidArgumentException: Currency '0' has an invalid value. Possible values are: Array. in /storage/ssd3/166/5686166/public_html/vendor/jay-nay/ost-kit-php-client/lib/OstKitClient.php:878
Stack trace:
#0 /storage/ssd3/166/5686166/public_html/vendor/jay-nay/ost-kit-php-client/lib/OstKitClient.php(830): ostkit\OstKitClient::validateOneOf(0, 'Currency', 'BT', 'USD')
#1 /storage/ssd3/166/5686166/public_html/vendor/jay-nay/ost-kit-php-client/lib/OstKitClient.php(492): ostkit\OstKitClient::validateAmount('4', 0, '20140.999998115...')

should pass 'BT', instead of 0

Correct, fixed now. Thanks for reporting, @jdurga.
Feel free to fork and create pull requests if you want to share some improvements 👍