Closed yehia67 closed 4 years ago
I asked the question on stalkoverflow:
https://stackoverflow.com/questions/58100720/what-is-the-difference-between-string-constant-and-string-between-quotes-a
the full source code :
https://github.com/yehia67/javascript-iota-workshop/blob/master/code/Send%20ID/fetchID.js
I call an async funtcion to fetch restricted mama message
no output will appear.But if I write
await FetchMamRestricted.execute('DOGDHTBWAKNZEVF9RPFPMLPNUZFUNHOCVESK9HFXRCJKATXBCPXKNYHHSQW9XCWRAM9JDPFWEBDUBZHRO') //root address It work!! Could anyone tell me how I could make it work using 'root' variable? Thanks in advance.
I know JavaScript language doesn't behave this way. What I think about the problem is the FetchMamRestricted.execute('DOGDHTBWAKNZEVF9RPFPMLPNUZFUNHOCVESK9HFXRCJKATXBCPXKNYHHSQW9XCWRAM9JDPFWEBDUBZHRO') content is:
I think the function
Mam.fetch(_root, mamType, mamSecret, logData)
have a bug(it's a build in function) on checking the first parameter using something like '==' not '==='.So it won't work unless I parse the string between '' to the parameter.