1

I have the above code

 mapping(string => Owner) public Owners;

    function addOwner( string memory name, string memory surname, string memory fathername, string memory mothername, string memory ethnicityId, string memory id) public returns(int8)
    {
        Owner memory owner;
        owner.name = name;
        owner.surname = surname;
        owner.fathername = fathername;
        owner.mothername = mothername;
        owner.ethnicityId = ethnicityId;
        owner.id = id;

        Owners[id] = owner;
        return 0;
    }

    function getOwnerName(string memory id) public returns(string memory, string memory) {
        Owner storage owner = Owners[id];
        return (owner.name, owner.surname);
    }


I am inserting an Owner with addOwner and try to retrieve with getOwnerName but Ringeby network is not returning the data I have inserted. The function returns the right data when I use the javascript VM on remix IDE

0

Declare function getOwnerName as view.

  • Yes! That's correct! – chatzich Apr 7 at 21:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.