hirosystems / clarinet

Write, test and deploy high-quality smart contracts to the Stacks blockchain and Bitcoin.
https://hiro.so/clarinet
GNU General Public License v3.0
290 stars 129 forks source link

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

Open ryanwaits opened 1 month ago

ryanwaits commented 1 month ago

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

hugocaillard commented 1 month ago

Thanks @ryanwaits Good catch!

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

0x2me commented 1 week ago

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

hugocaillard commented 1 week ago

@0x2me Can you give more details please?