dashed-slug.net › Forums › TurtleCoin Adapter extension support › Invalid number of decimals in deposits
- This topic has 32 replies, 3 voices, and was last updated 4 years, 4 months ago by alexg.
-
AuthorPosts
-
August 4, 2020 at 1:39 pm #9037d3vnu77Participant
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.August 4, 2020 at 1:42 pm #9039alexgKeymasterIf 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?
August 4, 2020 at 1:53 pm #9043d3vnu77ParticipantAugust 4, 2020 at 2:06 pm #9046alexgKeymasterMy apologies, my mistake. You should grep for
wallets_turtle_coins
, notwallets_turtle_coins_filter
.Also try to remember if you’ve done this.
August 4, 2020 at 3:10 pm #9048d3vnu77ParticipantGREP 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.August 4, 2020 at 3:58 pm #9050d3vnu77ParticipantOk, 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.August 4, 2020 at 4:04 pm #9055d3vnu77ParticipantGoing to completely delete this wallet and start over ran see if we can’t get a different result…
August 4, 2020 at 5:02 pm #9056d3vnu77ParticipantSame issue, installing on a new word press installation to test.
August 5, 2020 at 12:20 am #9057d3vnu77ParticipantSame issue on a fresh wordpress install with only the following newly installed plugins:
Bitcoin & Altcoin Wallets
Turtle Coin Adapter ExtensionDo 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.August 5, 2020 at 5:18 am #9065alexgKeymasterHello,
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
August 5, 2020 at 2:18 pm #9072d3vnu77ParticipantWhat 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.
August 5, 2020 at 3:01 pm #9079d3vnu77Participant1. 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?
August 6, 2020 at 8:00 am #9082alexgKeymasterHello,
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
August 7, 2020 at 7:07 pm #9102d3vnu77ParticipantI 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.August 10, 2020 at 7:27 am #9116alexgKeymasterHello,
Oops, yes, you are correct, the symbol is
ARMS
. I mistakenly indexed the array by the string2ACOIN
. 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' );
-
AuthorPosts
- You must be logged in to reply to this topic.