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
● Dictionary › should correctly serialize Buffer keys and Cell values
Index 256 > 256 is out of bounds
68 | // Check bounds
69 | if (index >= this._length) {
> 70 | throw new Error(`Index ${index} > ${this._length} is out of bounds`);
| ^
71 | }
72 | if (index < 0) {
73 | throw new Error(`Index ${index} < 0 is out of bounds`);
it("should correctly serialize Buffer keys and Cell values", async () => {
const keyLen = 256;
const keys = Dictionary.Keys.Buffer(keyLen);
const values = Dictionary.Values.Cell();
let testKey = await sha256("name");
let testVal = beginCell()
.storeUint(0x00, 8)
.storeBuffer(Buffer.from("Test", "utf8"))
.endCell();
let testDict = Dictionary.empty(keys, values);
testDict.set(testKey, testVal);
expect(testDict.get(testKey)!.equals(testVal)).toBe(true);
let serialized = beginCell().storeDictDirect(testDict).endCell();
let dictDs = Dictionary.loadDirect(keys, values, serialized);
expect(dictDs.get(testKey)!.equals(testVal)).toBe(true);
});
The text was updated successfully, but these errors were encountered:
● Dictionary › should correctly serialize Buffer keys and Cell values
The text was updated successfully, but these errors were encountered: