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

function eth_workaround_eth_coinbase($val) #13

Closed
Cryt1c opened this issue Feb 9, 2018 · 2 comments
Closed

function eth_workaround_eth_coinbase($val) #13

Cryt1c opened this issue Feb 9, 2018 · 2 comments
Labels

Comments

@Cryt1c
Copy link
Contributor

Cryt1c commented Feb 9, 2018

Hi @digitaldonkey ,

thanks for providing this interface and also the drupal/ethereum module!
I would like to contribute to this project too.
Currently I try to get the dev branch running on my environment but I have a problem, when I use the INFURA net because eth_coinbase is not supported by them.
I have found these workaround:

{
    // WORKAROUND: Catch a "405 Method Not Allowed'.
    if (isset($val['error']) && $val['error'] && $val['code'] == 405) {
        return '0x0000000000000000000000000000000000000000';
    } else {
        return $val;
    }
}

But as I see it they are not used at the moment, which breaks the drupal/ethereum module because ethereum-php throws an Exception which is not caught (Expected EthD20 at eth_coinbase (), couldn not be decoded. Value was: Array).
Where should this workaround be used? Can I help you with this? Would be happy to create a PR if you could point me into the right direction.

Thanks for your work!

@digitaldonkey
Copy link
Owner

I have found these workaround. But as I see it they are not used at the moment

The workarounds should be called in

$functionName = 'eth_workaround_' . $method;
if (function_exists($functionName)) {
$value = call_user_func($functionName, $value);
}

If this is not happening https://github.com/digitaldonkey/ethereum-php/blob/dev/src/helpers/ethereum-client-workaround-helpers.php is not included correctly, which would be a bug sneaked in during refactoring.

ethereum-php throws an Exception which is not caught (Expected EthD20 at eth_coinbase (), couldn not be decoded. Value was: Array).

Array values are not yet implemented in the library.

I assume the helper file is not included.

I would like to contribute to this project too.
You are very welcome. PM me if you want to schedule a call, so I can tell you what I'm working on currently.

@digitaldonkey
Copy link
Owner

Seems src/helpers/ethereum-client-workaround-helpers.php is not loaded.

--> #14

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

No branches or pull requests

2 participants