Giter Site home page Giter Site logo

Comments (8)

digitaldonkey avatar digitaldonkey commented on June 26, 2024

uint[] is not supported the library yet. I consider to add https://github.com/sc0Vu/rlp but I need to do some Drupal work first.

from ethereum-php.

danielefavi avatar danielefavi commented on June 26, 2024

Without uint[] I'm getting the exception
Call to a member function convertByAbi() on integer
raised by the function getMethodParams($m, $values) of the file SmartContract.php on line 138
$validAbiType = $val->convertByAbi($expectedType);

This is the new declaration of the function getProductById on the smart contract:

function getProductById(uint id) public view
returns (
    uint,
    string,
    bytes32,
    uint,
    uint,
    bool
) {
    ...
}

I would like to know if this exception is related to this issue.
Thank you

from ethereum-php.

digitaldonkey avatar digitaldonkey commented on June 26, 2024

"Call to a member function convertByAbi() on integer" means that the integer is not a Instance of EthD.

Your calls should look similar to

$contract->getProductById(new EthQ($yourInt))

from ethereum-php.

danielefavi avatar danielefavi commented on June 26, 2024

The call you mentioned gives me again the exception
NOT IN RANGE: 1277465586268147 ... ... ... 887421292544000 > (u)int256

Instead, it works with smart contract functions that returns one value only. For example this is the function on the smart contract side:
function getProductName(uint id) public view returns (string) { ... }

and, in this case, the following call works correctly

$prdName = $instance->getProductName(new EthQ(123));

I didn't get if I don't use properly your library or the feature with multiple values in return is not supported.

from ethereum-php.

tomaszbag avatar tomaszbag commented on June 26, 2024

Hi,
What syntax should be used for receiving outbound parameters?

function getProductById(uint32 id) public view
returns (
    uint,
    string,
    bytes32,
    uint,
    uint,
    bool
)

To call above function I'm using:

$result = $schemaContract->getProductById(new EthQ($number, ['abi'=>'uint32']));

But 'left' part ($result) is wrong because function getProductById returns many parameters.

Can you help me how above syntax should looks like to get many outbound parameters?
Is it possible with your library or it is not supported yet?
Thx

from ethereum-php.

digitaldonkey avatar digitaldonkey commented on June 26, 2024

As far as I understand without actual testing you are returning a list value, which is not supported yet.
You might add your contract and some test to the test contracts.

from ethereum-php.

digitaldonkey avatar digitaldonkey commented on June 26, 2024

Let's get some test Data from https://ethereum.stackexchange.com/a/681/852

from ethereum-php.

digitaldonkey avatar digitaldonkey commented on June 26, 2024

Should work now, but needs more testing.
https://github.com/digitaldonkey/ethereum-php/tree/dev

from ethereum-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.