Skip to main content

Timeline for Return a mapping in Truffle test

Current License: CC BY-SA 3.0

11 events
when toggle format what by license comment
Jan 1, 2022 at 4:31 comment added Ismael @Ebube In my answer it is noted that it should be declared as public.
Dec 30, 2021 at 18:59 comment added Ebube It should only work for public mappings. The one specified in the question is private.
Mar 7, 2018 at 15:04 comment added jlansey This answer worked well for me, thank you very much.
Dec 28, 2017 at 22:20 vote accept Jorge
Dec 20, 2017 at 1:23 comment added Jorge But I think it doesn´t depend on the code. If the declaration is the same...and the way how you call the variable across the test is the same...I don´t understand why you are doing the process OK.
Dec 13, 2017 at 20:06 comment added Ismael @Jorge It does work for me, perhaps my example is different. Without more code I cannot test what is wrong with yours.
Dec 13, 2017 at 20:04 history edited Ismael CC BY-SA 3.0
Grammar was bad
Dec 13, 2017 at 19:02 comment added Jorge Ah ok,but I also tried that way. Return Invalid number of arguments to Solidity function. I´ve tried calling in different ways: call(accounts[0]),call(acounts[0][0]), call({from: accounts[0]}) and call({from: accounts[0][0]}). And also, I´ve kept away accounts[0] in a var and tried all ways, but the same result...
Dec 13, 2017 at 4:02 comment added Ismael @Jorge Note that I've added the public qualifier to balanceOf declaration.
Dec 13, 2017 at 2:38 comment added Jorge That step in the test doesn´t work....returns : TypeError: Cannot read property 'call' of undefined...I´ve tried call balanceOf using accounts[0] and also {from: accounts[0]}....
Dec 12, 2017 at 3:52 history answered Ismael CC BY-SA 3.0