Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ryanwaits opened this issue May 17, 2024 · 3 comments
Assignees
Labels
clarinet-sdk Issues related to the Clarinet JavaScript SDK

Comments

@ryanwaits
Copy link
Contributor

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]
@github-project-automation github-project-automation bot moved this to 🆕 New in DevTools May 17, 2024
@hugocaillard hugocaillard moved this from 🆕 New to 📋 Backlog in DevTools May 17, 2024
@hugocaillard hugocaillard self-assigned this May 17, 2024
@hugocaillard
Copy link
Collaborator

hugocaillard commented May 17, 2024

Thanks @ryanwaits
Good catch!

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

@0x2me
Copy link

0x2me commented Jun 20, 2024

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

@hugocaillard
Copy link
Collaborator

@0x2me Can you give more details please?

@hugocaillard hugocaillard added the clarinet-sdk Issues related to the Clarinet JavaScript SDK label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarinet-sdk Issues related to the Clarinet JavaScript SDK
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants