I am currently writing tests for solidity contract using truffle. When I invoke a function from the contract with .call(), the object that is being returned to me has the values included twice, once with their keys and a second time with an array index associated with the values.
For example, I would expect my return value to be:
{
name: 'jeff',
id: '0'
}
Instead, I am receiving:
{
'0': 'jeff',
'1': 0,
name: 'jeff',
id: '0'
}
While the correct data is there, it would make my tests much cleaner if I only received the key value pairs, and not this strange array structure in addition.
How can I prevent truffle from returning these duplicates?
node_modules
) and fix it manually, but it don't think that it is advisable to do so, in particularly, since you can simply ignore that piece of information in your own code.