I've created a consortium based network where I have two contracts deployed.
pragma solidity ^0.4.4;
contract ScoreStore{
mapping(string => int) PersonScores;
function AddPersonScore(string name, int startingScore){
if(PersonScores[name]>0){
throw;
} else {
PersonScores[name] = startingScore;
}
}
function GetScore(string name) returns (int){
return PersonScores[name];
}
}
This contract works no problem when interacting with it directly. The second contract:
pragma solidity ^0.4.4;
contract IScoreStore{
function GetScore(string name) returns (int);
}
contract MyGame{
function ShowScore(string name) returns (int)
{
IScoreStore scoreStore = IScoreStore(0xEB058f7E140991811ff815335DA5bB7e593c8359);
return scoreStore.GetScore(name);
}
}
When I make a call to the MyGame contract to ShowScore("Oliver") it returns
{ [String: '0'] s: 1, e: 0, c: [ 0 ] }
When I call GetScore("Oliver") through the ScoreStore contract I get the expected result
{ [String: '15'] s: 1, e: 1, c: [ 15 ] }
What is it that I'm missing?