我有上面的代码
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);
}
我正在插入具有addOwner的Owner,并尝试使用getOwnerName进行检索,但是Ringeby网络未返回我插入的数据。当我在remix IDE上使用javascript VM时,该函数返回正确的数据