From 079de2459a1878f0d71af37ba4359a4233567da6 Mon Sep 17 00:00:00 2001 From: Upamanyu Sharma Date: Tue, 3 Dec 2024 15:53:39 -0500 Subject: [PATCH] Fix for goose --- merkle/merkle.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/merkle/merkle.go b/merkle/merkle.go index e16aa03..57d9355 100644 --- a/merkle/merkle.go +++ b/merkle/merkle.go @@ -69,7 +69,9 @@ func (t *Tree) Put(label []byte, mapVal []byte) ([]byte, []byte, bool) { // make leaf node with correct hash. lastInterior := interiors[cryptoffi.HashLen-1] - lastPos := label[cryptoffi.HashLen-1] + // XXX: To deal with goose failing to handle the implicit conversion to int + // when using as a slice index + lastPos := uint64(label[cryptoffi.HashLen-1]) lastInterior.children[lastPos] = &node{mapVal: mapVal, hash: compLeafNodeHash(mapVal)} // correct hashes of interior nodes, bubbling up.