From 74faf3505b475519baaed1a0a17734d7c0bd699c Mon Sep 17 00:00:00 2001 From: Tudor Malene Date: Tue, 20 Aug 2024 16:59:05 +0100 Subject: [PATCH] change brotli writer --- go/common/compression/data_compression_service.go | 3 ++- go/enclave/main/main.go | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go/common/compression/data_compression_service.go b/go/common/compression/data_compression_service.go index ed0048674d..445c87b94f 100644 --- a/go/common/compression/data_compression_service.go +++ b/go/common/compression/data_compression_service.go @@ -36,7 +36,8 @@ func (cs *brotliDataCompressionService) Decompress(in []byte) ([]byte, error) { func (cs *brotliDataCompressionService) compress(in []byte, level int) ([]byte, error) { var buf bytes.Buffer - writer := brotli.NewWriterLevel(&buf, level) + // writer := brotli.NewWriterLevel(&buf, level) + writer := brotli.NewWriterV2(&buf, level) _, err := writer.Write(in) if closeErr := writer.Close(); err == nil { err = closeErr diff --git a/go/enclave/main/main.go b/go/enclave/main/main.go index fa798e2241..d558de853b 100644 --- a/go/enclave/main/main.go +++ b/go/enclave/main/main.go @@ -2,13 +2,14 @@ package main import ( "fmt" + "os" + "runtime/pprof" + "time" + "github.com/ten-protocol/go-ten/go/common/container" tenflag "github.com/ten-protocol/go-ten/go/common/flag" "github.com/ten-protocol/go-ten/go/config" enclavecontainer "github.com/ten-protocol/go-ten/go/enclave/container" - "os" - "runtime/pprof" - "time" ) // Runs an Obscuro enclave as a standalone process.