1package commit23import (4 "testing"56 "gno.land/p/nt/uassert/v0"7)89func TestHashDeterministicAndPrefixed(t *testing.T) {10 uassert.Equal(t, Hash("a", "bc"), Hash("a", "bc"))11 // length-prefixing prevents boundary collisions12 uassert.NotEqual(t, Hash("ab", "c"), Hash("a", "bc"))13 uassert.Equal(t, 64, len(Hash("x"))) // sha256 hex is 64 chars14}1516func TestVerdictCommitReveal(t *testing.T) {17 c := Verdict(true, "salt-123")18 // reproducible from the revealed values19 uassert.Equal(t, c, Verdict(true, "salt-123"))20 // flipping the vote or the salt changes the commitment21 uassert.NotEqual(t, c, Verdict(false, "salt-123"))22 uassert.NotEqual(t, c, Verdict(true, "salt-999"))23}2425func TestShort(t *testing.T) {26 uassert.Equal(t, "abc", Short("abc"))27 uassert.True(t, len(Short(Hash("x"))) < 20)28}29Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.