I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Invalid number of decimals in deposits

dashed-slug.net Forums TurtleCoin Adapter extension support Invalid number of decimals in deposits

Tagged: ,

Viewing 3 posts - 31 through 33 (of 33 total)
  • Author
    Posts
  • #9127
    d3vnu77
    Participant

    I can confirm that adding the following code:

    function wallets_turtlecoin_adapter_filter( $coins ) {
        $coins['ARMS']['amount pattern'] = '%01.8f';
        $coins['ARMS']['decimals'] = 8;
    
        error_log(print_r( $coins, true ));
        return $coins;
    }
    add_filter( 'wallets_turtle_coins', 'wallets_turtlecoin_adapter_filter' );

    1. The method gets called
    2. The $coins variable does get changed, based on the debug.log output.
    3. The change has NO effect on the decimal placement that gets inserted into the database.

    The only way to make it work at the moment is to change the following code from a 2 to an 8:

    public function get_decimal_places() {
         return 8;
    }

    I think that you have a bug in your code that causes it to only use what this function outputs, I’m going to try to bring my wallets back up on my site using this fix. Do you mind double checking your code to see if that is the case for me when you get a chance?

    #9131
    alexg
    Keymaster

    I will investigate this using TurtleCoin and get back to you.

    #9134
    alexg
    Keymaster

    Yep, you were absolutely correct. There was a typo in there. I have now released version 0.1.3-beta where this is fixed. I have set the number of decimals for 2ACoin to 8 (previously was 4). I am not sure if this is correct, since block explorers seem to show the decimals set to 4. In any case, you can now modify this value using the WordPress filter.

    Many thanks for spotting this bug.

Viewing 3 posts - 31 through 33 (of 33 total)
  • You must be logged in to reply to this topic.