clarinet
clarinet copied to clipboard
calling `getMapEntry` in Clarinet SDK for non-existent entry returns error instead of `Cl.none`
Describe the bug
Calling the getMapEntry function in the Clarinet SDK for an entry that doesn't exist returns an error with the message "value not found" instead of returning Cl.none, as expected.
To Reproduce Steps to reproduce the behavior:
- Initialize the simnet object.
- Call
simnet.getMapEntry("contract", "map-name", Cl.standardPrincipal(address))for a non-existent entry.
Expected behavior
The function getMapEntry should return Cl.none - or { type: 9 } - when the requested entry does not exist, instead of throwing an error.
Environment
- Clarinet SDK version [2.6.0]
Thanks @ryanwaits Good catch!
Note to self: we should still return an error if the map name doesn't exist
I'm getting the error whether the value exist in the map or not.
@0x2me Can you give more details please?