import types/tries package only once

This commit is contained in:
Black Swan 2025-11-18 00:34:52 +02:00
parent 4c021b988c
commit 522f95cb21

View File

@ -31,7 +31,6 @@ import (
"source.quilibrium.com/quilibrium/monorepo/protobufs"
application "source.quilibrium.com/quilibrium/monorepo/types/hypergraph"
"source.quilibrium.com/quilibrium/monorepo/types/tries"
crypto "source.quilibrium.com/quilibrium/monorepo/types/tries"
"source.quilibrium.com/quilibrium/monorepo/verenc"
)
@ -59,7 +58,7 @@ func TestHypergraphSyncServer(t *testing.T) {
data1 := enc.Encrypt(make([]byte, 20), pub)
verenc1 := data1[0].Compress()
vertices1 := make([]application.Vertex, numOperations)
dataTree1 := &crypto.VectorCommitmentTree{}
dataTree1 := &tries.VectorCommitmentTree{}
logger, _ := zap.NewDevelopment()
inclusionProver := bls48581.NewKZGInclusionProver(logger)
for _, d := range []application.Encrypted{verenc1} {
@ -273,7 +272,7 @@ func TestHypergraphSyncServer(t *testing.T) {
}
time.Sleep(10 * time.Second)
str.CloseSend()
leaves := crypto.CompareLeaves(
leaves := tries.CompareLeaves(
crdts[0].(*hgcrdt.HypergraphCRDT).GetVertexAddsSet(shardKey).GetTree(),
crdts[1].(*hgcrdt.HypergraphCRDT).GetVertexAddsSet(shardKey).GetTree(),
)
@ -298,7 +297,7 @@ func TestHypergraphSyncServer(t *testing.T) {
crdts[0].(*hgcrdt.HypergraphCRDT).GetVertexAddsSet(shardKey).GetTree().Commit(false),
crdts[1].(*hgcrdt.HypergraphCRDT).GetVertexAddsSet(shardKey).GetTree().Commit(false),
) {
leaves := crypto.CompareLeaves(
leaves := tries.CompareLeaves(
crdts[0].(*hgcrdt.HypergraphCRDT).GetVertexAddsSet(shardKey).GetTree(),
crdts[1].(*hgcrdt.HypergraphCRDT).GetVertexAddsSet(shardKey).GetTree(),
)
@ -331,7 +330,7 @@ func TestHypergraphPartialSync(t *testing.T) {
data1 := enc.Encrypt(make([]byte, 20), pub)
verenc1 := data1[0].Compress()
vertices1 := make([]application.Vertex, numOperations)
dataTree1 := &crypto.VectorCommitmentTree{}
dataTree1 := &tries.VectorCommitmentTree{}
logger, _ := zap.NewDevelopment()
inclusionProver := bls48581.NewKZGInclusionProver(logger)
domain := make([]byte, 32)
@ -628,7 +627,7 @@ func TestHypergraphPartialSync(t *testing.T) {
log.Fatalf("Client: failed to sync 1: %v", err)
}
str.CloseSend()
leaves := crypto.CompareLeaves(
leaves := tries.CompareLeaves(
crdts[0].(*hgcrdt.HypergraphCRDT).GetVertexAddsSet(shardKey).GetTree(),
crdts[1].(*hgcrdt.HypergraphCRDT).GetVertexAddsSet(shardKey).GetTree(),
)
@ -751,7 +750,7 @@ func TestHypergraphPartialSync(t *testing.T) {
crdts[0].(*hgcrdt.HypergraphCRDT).GetVertexAddsSet(shardKey).GetTree().Commit(false),
crdts[1].(*hgcrdt.HypergraphCRDT).GetVertexAddsSet(shardKey).GetTree().Commit(false),
) {
leaves := crypto.CompareLeaves(
leaves := tries.CompareLeaves(
crdts[0].(*hgcrdt.HypergraphCRDT).GetVertexAddsSet(shardKey).GetTree(),
crdts[1].(*hgcrdt.HypergraphCRDT).GetVertexAddsSet(shardKey).GetTree(),
)