Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sendTransaction error occured with the ether value of more than 3 digits. #4

Open
tm-takashi opened this issue Jan 25, 2018 · 3 comments

Comments

@tm-takashi
Copy link

I tried to send a transaction with ether value over 100 like the following.

$transaction = new \EthereumPHP\Types\Transaction(
    $myAddress,
    $otherAddress,
    null,
    null,
    null,
    (new \EthereumPHP\Types\Ether(100))->toWei()->amount()
);

and then I got the error message from php.

Argument 6 passed to EthereumPHP\Types\Transaction::__construct() must be of the type integer or null, float given,

It seems number of more than 3 digits exceeds int range and implicit type transformation happened to the variable as float.

How should I do if I want to set the number of more than 3 digits?

@kesar
Copy link
Owner

kesar commented Jan 25, 2018

Oh, that's true. I will need to refactor that part and implement some library for big numbers like this one ( https://github.com/Litipk/php-bignumbers )

@tm-takashi
Copy link
Author

Thank you so much for your answer.
I understand more than 3 digits number can't process for now.

I don't have a plan with processing over 3 digits for a while so I look forward to your refactoring.

@kesar
Copy link
Owner

kesar commented Jan 26, 2018

I don't have a plan with processing over 3 digits for a while so I look forward to your refactoring.

Good that you are not planning to move more than 1M$ using this library, I would be a bit worried as its in development :D :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants