You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't find an example of simnet.getMapEntry.
It 's use seems to be quite straightforward, but there is an issue if I want to use a string as the key type for the map.
It won't find the mapped value.
Unless someone tells me that I'm doing it all wrong.
let key: ClarityValue = Cl.stringUtf8("test1");
let value: ClarityValue = Cl.stringUtf8("do something");
//first add something
const addMessage: any = simnet.callPublicFn("hello-stacks", "add-message", [key, value], address);
expect(addMessage.result.type).toBe(ClarityType.ResponseOk);
expect(addMessage.result.value.data).toBe("do something");
console.log("1 ok");
//then try to retrieve it
let key: ClarityValue = Cl.stringUtf8("test1");
const found: ClarityValue = simnet.getMapEntry("hello-stacks", "messages", key);
expect(found).toBe("do something");
console.log("6 ok");
The text was updated successfully, but these errors were encountered:
I can't find an example of simnet.getMapEntry.
It 's use seems to be quite straightforward, but there is an issue if I want to use a string as the key type for the map.
It won't find the mapped value.
Unless someone tells me that I'm doing it all wrong.
The text was updated successfully, but these errors were encountered: