From 0bea1c8b7a1472347b151639c5cdd3082979e967 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Tue, 3 Oct 2023 21:58:16 -0600 Subject: [PATCH] stable_structures clean up --- src/lib/stable_b_tree_map.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/stable_b_tree_map.ts b/src/lib/stable_b_tree_map.ts index 1300f12842..5773174785 100644 --- a/src/lib/stable_b_tree_map.ts +++ b/src/lib/stable_b_tree_map.ts @@ -1,4 +1,4 @@ -import { CandidType, TypeMapping, toIDLType } from './candid'; +import { CandidType, TypeMapping } from './candid'; import { None, Opt, Some } from './candid/types/constructed/opt'; import { nat64 } from './candid/types/primitive/nats/nat64'; import { nat8 } from './candid/types/primitive/nats/nat8'; @@ -8,10 +8,7 @@ export function StableBTreeMap< Key extends CandidType, Value extends CandidType >(keyType: Key, valueType: Value, memoryId: nat8) { - const keyIdl = toIDLType(keyType, []); - const valueIdl = toIDLType(valueType, []); - - const candidEncodedMemoryId = new Uint8Array(encode(nat8, memoryId)).buffer; + const candidEncodedMemoryId = encode(nat8, memoryId).buffer; if ((globalThis as any)._azleIc !== undefined) { (globalThis as any)._azleIc.stableBTreeMapInit(candidEncodedMemoryId);