Open extra topbar

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 15 posts - 16 through 30 (of 33 total)
  • Author
    Posts
  • #9037
    d3vnu77
    Participant

    Modifing the coins.csv had no effect, if I dump the $coin variable in wallets_declare_adapters() it shows that decimals have been set to 10 or 8 or whatever is set in the coins.csv file.

    I just re-downloaded the turtle-coin adapter source code and overwrote everything to ensure I made no edits. Reedited the coins.csv to 8 decimals, however when inserted into the database I am still only getting the decimal place to move by 2 places compared to what the RPC is saying.

    Mofidying the coin.csv has no effect.

    Attachments:
    You must be logged in to view attached files.
    #9039
    alexg
    Keymaster

    If modifying the coins.csv file has no effect, this can only mean that you’ve overridden the data using the filter elsewhere.

    So grep your functions php or any other theme or plugin code to see if you’ve used the wallets_turtle_coins_filter anywhere.

    Could it be that you’ve done this?

    #9043
    d3vnu77
    Participant

    I don’t think so.

    here is grep output

    Attachments:
    You must be logged in to view attached files.
    #9046
    alexg
    Keymaster

    My apologies, my mistake. You should grep for wallets_turtle_coins, not wallets_turtle_coins_filter.

    Also try to remember if you’ve done this.

    #9048
    d3vnu77
    Participant

    GREP returned only your instance of apply_filters as seen in the screenshot.

    I’m at a loss.

    Attachments:
    You must be logged in to view attached files.
    #9050
    d3vnu77
    Participant

    Ok, so I think I might have found something. If I dump the results of all the transactions… as seen in your code. I have some transactions from the other wallet…

    The address: “gunsLxp8FSQ3eU4Frhutze3QrE4acGM5LDiW5AFWc7mHSTDFnpht7oce9PzmJxJycs1SKG1aC8dvUgUBs2XSQkv29RE9d9Gs46” as seen in the screenshot is an address that was generated on the old wallet by a friend of mine, the amount is deposited by our pool. As you can see she is currently mining… and number 3.

    https://pool.n2aa.org/#top10miners

    Why would this be showing up in the new wallets transactions? They are not being inserted into the database and the address does not exist any longer in wp_wallets_adds.

    It is showing up in the transactions though… as seen in the screenshots.

    Attachments:
    You must be logged in to view attached files.
    #9055
    d3vnu77
    Participant

    Going to completely delete this wallet and start over ran see if we can’t get a different result…

    #9056
    d3vnu77
    Participant

    Same issue, installing on a new word press installation to test.

    #9057
    d3vnu77
    Participant

    Same issue on a fresh wordpress install with only the following newly installed plugins:

    Bitcoin & Altcoin Wallets
    Turtle Coin Adapter Extension

    Do you use signal? I can get you the authentication for my test server and you can check, if you want.

    Attachments:
    You must be logged in to view attached files.
    #9065
    alexg
    Keymaster

    Hello,

    The place where you have placed the hook displays all transactions related to your wallet file, not only transactions related to your WordPress installation. After the wallets_transactions action fires, the plugin will determine whether to save the transaction to the DB or not, based on the deposit addresses.

    Please post in new threads for things that are unrelated to the original issue, i.e. the number of decimals.

    I do not communicate over signal or any other messaging app. This helps keep communication clear and also it allows me to work on development. Additionally, I cannot solve your issues remotely.

    To summarize:
    You have already managed once to modify the number of decimals.

    If you start from the unmodified code of version 0.1.2-beta, then fiddle with the number of decimals, you should be able to resolve the original issue. If you have any other questions on how the code works, please open as many new threads as needed.

    with regards

    #9072
    d3vnu77
    Participant

    What I am saying is. I installed only those two plugins directly off your website on a new wordpress installation, without any other code or themes, etc.

    Even on the new test website with only wordpress and the Bitcoin & Altcoin Wallets Plugin and the TurtleCoin Adapter Plugin, the behavior on the Invalid number of decimals, continues.

    1. No matter what you input as decimals in the coins.csv file. The inserts to the database are always 6 decimals out of place on a brand new install and brand new wallet.

    It is always 2 decimals off from what the RPC is reporting as the amount.

    #9079
    d3vnu77
    Participant

    1. The only way that I have figured out how to change the decimals is to change the hardcoded value that is currently 2 in the get_decimal_places of coin-adapter-turtlecoin.php

    2. The fact that I can change this and the decimals do change, should say that this is where the app is getting the decimal value from… not the coin.csv (if I change, it does nothing). Not the wallets_turtle_coins_filter… if I add it does nothing.

    The only way to get the correct value is change the hardcoded value of get_decimal_places method. I think your code might have a bug in it, have you fully tested with 2ACoin?

    #9082
    alexg
    Keymaster

    Hello,

    I have NOT had the time to test with 2ACoin.

    What value did you insert in the code to make it work? If you are certain that this value works, I can put that value in there.

    with regards

    #9102
    d3vnu77
    Participant

    I put a value of 8 into the get_decimal_places function.

    I have NOT gotten it to work by putting a value of 8 in the coins.csv file on the production server or the test server with only your plugins installed.

    I have NOT gotten it to work by adding the following code to the themes function.php or a separate plugin (see attached image, some reason it will not let me post code here), on the production server or the test server…

    The only thing that seems to work is putting a value of 8 into the get_decimal_places function. Then is displays correctly…as seen in the image

    ________________________________

    On a secondary note, thinking out loud here I notice when you posted the filter here: https://www.dashed-slug.net/forums/topic/im-getting-ready-to-replace-my-hacked-up-monero-adapter-with-yours/page/3/#post-8943

    I notice you used 2ACOIN as the key for the array, is that what it is supposed to be, because my $coins variable gets passed through with the $coins[‘ARMS’] key….

    Attachments:
    You must be logged in to view attached files.
    #9116
    alexg
    Keymaster

    Hello,

    Oops, yes, you are correct, the symbol is ARMS. I mistakenly indexed the array by the string 2ACOIN. My apologies.

    So when you use the following filter, with the code otherwise unmodified, decimals should work correctly:

    function wallets_turtlecoin_adapter_filter( $coins ) {
        $coins['ARMS']['amount pattern'] = '%01.8f';
        $coins['ARMS']['decimals'] = 8;
    
        return $coins;
    }
    add_filter( 'wallets_turtle_coins', 'wallets_turtlecoin_adapter_filter' );
Viewing 15 posts - 16 through 30 (of 33 total)
  • You must be logged in to reply to this topic.