I have the following struct inside my vyper file:
races: public({
start: timestamp,
end: timestamp,
racersBetHash: bytes32[address],
racersBetAmount: wei_value[address]
}[int128])
Then I call this function:
@public
@payable
def registerRacerBet(_tokenHash: bytes32, _raceID: int128) -> bool:
self.races[_raceID].racersBetAmount[msg.sender] = msg.value
self.races[_raceID].racersBetHash[msg.sender] = _tokenHash
log.NewUserBet(_raceID, msg.sender,
self.races[_raceID].racersBetHash[msg.sender],
self.races[_raceID].racersBetAmount[msg.sender])
return True
Inside my truffle test, I'm able to test the correctness of the log, so I'm sure that the struct is properly defined but, if I try to read the value of the struct for the two mapping fiels the call turns back zero value.
I have no problems to read start
and end
const currentHashBet = await instance.races__racersBetHash.call(0, '0xf17f52151ebef6c7334fad080c5704d77216b732');
currentHashBet: 0x0000000000000000000000000000000000000000000000000000000000000000