clarinet icon indicating copy to clipboard operation
clarinet copied to clipboard

calling `getMapEntry` in Clarinet SDK for non-existent entry returns error instead of `Cl.none`

Open ryanwaits opened this issue 1 year ago • 3 comments

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:

  1. Initialize the simnet object.
  2. 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]

ryanwaits avatar May 17 '24 14:05 ryanwaits

Thanks @ryanwaits Good catch!

Note to self: we should still return an error if the map name doesn't exist

hugoclrd avatar May 17 '24 14:05 hugoclrd

I'm getting the error whether the value exist in the map or not.

0x2me avatar Jun 20 '24 16:06 0x2me

@0x2me Can you give more details please?

hugoclrd avatar Jun 20 '24 16:06 hugoclrd