Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Sep 14, 2023
1 parent 9c076e2 commit 12c7e99
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package mgmtcontractlib

import (
"bytes"
"compress/gzip"
"encoding/base64"
"fmt"
"io"
"math/big"
"strings"

Expand Down Expand Up @@ -82,11 +79,7 @@ func (c *contractLibImpl) DecodeTx(tx *types.Transaction) ethadapter.L1Transacti
if !found {
panic("call data not found for rollupData")
}
zipped := Base64DecodeFromString(callData.(string))
rollup, err := Decompress(zipped)
if err != nil {
panic(err)
}
rollup := Base64DecodeFromString(callData.(string))

return &ethadapter.L1RollupTx{
Rollup: rollup,
Expand Down Expand Up @@ -322,18 +315,6 @@ func Base64DecodeFromString(in string) []byte {
return bytesStr
}

// Decompress the byte array using gzip
func Decompress(in []byte) ([]byte, error) {
reader := bytes.NewReader(in)
gz, err := gzip.NewReader(reader)
if err != nil {
return nil, err
}
defer gz.Close()

return io.ReadAll(gz)
}

func convertCrossChainMessages(messages []MessageBus.StructsCrossChainMessage) []ManagementContract.StructsCrossChainMessage {
msgs := make([]ManagementContract.StructsCrossChainMessage, 0)

Expand Down

0 comments on commit 12c7e99

Please sign in to comment.