Skip to content

Commit

Permalink
Deps: Updating merkle tree library (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
dahn510 authored Nov 8, 2023
2 parents 5380f0a + 3ef4ccb commit 6bdaffb
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 21 deletions.
8 changes: 2 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tendermint/tendermint v0.34.27
github.com/tendermint/tm-db v0.6.7
github.com/wealdtech/go-merkletree v1.0.0
github.com/zondax/hid v0.9.1 // indirect
google.golang.org/genproto v0.0.0-20230320184635-7606e756e683
google.golang.org/grpc v1.55.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/iavl v0.19.5 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
Expand Down Expand Up @@ -113,15 +112,13 @@ require (
github.com/improbable-eng/grpc-web v0.14.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.7.10 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
Expand All @@ -146,6 +143,7 @@ require (
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tidwall/btree v1.5.0 // indirect
github.com/wealdtech/go-merkletree/v2 v2.5.1-0.20231106114422-6769f4468d71
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
golang.org/x/crypto v0.8.0 // indirect
Expand Down Expand Up @@ -180,8 +178,6 @@ replace (

github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27

github.com/wealdtech/go-merkletree => github.com/TheMarstonConnell/go-merkletree v0.0.0-20230328183338-b5d590ab1aaf

// use grpc compatible with cosmos-flavored protobufs
google.golang.org/grpc => google.golang.org/grpc v1.33.2
)
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06/go.mod h1:7erjK
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/TheMarstonConnell/go-merkletree v0.0.0-20230328183338-b5d590ab1aaf h1:K8hLTtjPxDCIjb/YNncNWHTWDpubfPFbXWGE8vAQC4g=
github.com/TheMarstonConnell/go-merkletree v0.0.0-20230328183338-b5d590ab1aaf/go.mod h1:Dpt5BLOsKmHAA6gAs3lyo9EKaLq2glBsEoHj3RqfN+Q=
github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw=
github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
Expand Down Expand Up @@ -685,7 +683,6 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfC
github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U=
github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
Expand Down Expand Up @@ -792,7 +789,6 @@ github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPK
github.com/mailgun/raymond/v2 v2.0.46/go.mod h1:lsgvL50kgt1ylcFJYZiULi5fjPBkkhNfj4KA0W54Z18=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ=
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2/go.mod h1:0KeJpeMD6o+O4hW7qJOT7vyQPKrWmj26uf5wMc/IiIs=
Expand Down Expand Up @@ -1194,6 +1190,8 @@ github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
github.com/wealdtech/go-merkletree/v2 v2.5.1-0.20231106114422-6769f4468d71 h1:6CdfLVLgeh6MjVbn3dyNFUU3QJXhVBriv9QTg7Hy7vk=
github.com/wealdtech/go-merkletree/v2 v2.5.1-0.20231106114422-6769f4468d71/go.mod h1:NL3IVC+cwXMegkCY4SyPPMee3sYIBM+msyFOEhQS+qM=
github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
Expand Down
4 changes: 2 additions & 2 deletions x/storage/keeper/msg_server_proofs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/jackalLabs/canine-chain/v3/testutil"
"github.com/jackalLabs/canine-chain/v3/x/storage/types"

"github.com/wealdtech/go-merkletree"
"github.com/wealdtech/go-merkletree/sha3"
"github.com/wealdtech/go-merkletree/v2"
"github.com/wealdtech/go-merkletree/v2/sha3"
)

type TestFile struct {
Expand Down
4 changes: 2 additions & 2 deletions x/storage/simulation/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"strings"

sdksim "github.com/cosmos/cosmos-sdk/types/simulation"
merkle "github.com/wealdtech/go-merkletree"
"github.com/wealdtech/go-merkletree/sha3"
merkle "github.com/wealdtech/go-merkletree/v2"
"github.com/wealdtech/go-merkletree/v2/sha3"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions x/storage/types/file_deal.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerror "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/tendermint/tendermint/libs/rand"
"github.com/wealdtech/go-merkletree"
"github.com/wealdtech/go-merkletree/sha3"
"github.com/wealdtech/go-merkletree/v2"
"github.com/wealdtech/go-merkletree/v2/sha3"
)

// VerifyProof checks whether a proof is valid against a file
Expand Down
4 changes: 2 additions & 2 deletions x/storage/types/file_deal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

"github.com/jackalLabs/canine-chain/v3/x/storage/types"
"github.com/stretchr/testify/require"
"github.com/wealdtech/go-merkletree"
"github.com/wealdtech/go-merkletree/sha3"
"github.com/wealdtech/go-merkletree/v2"
"github.com/wealdtech/go-merkletree/v2/sha3"
)

// copied from the provider code, we should probably make this an import for the providers
Expand Down
7 changes: 4 additions & 3 deletions x/storage/utils/trees.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package utils
import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"io"

"github.com/wealdtech/go-merkletree"
"github.com/wealdtech/go-merkletree/sha3"
"github.com/wealdtech/go-merkletree/v2"
"github.com/wealdtech/go-merkletree/v2/sha3"
)

func BuildTree(buf io.Reader, chunkSize int64) ([]byte, []byte, [][]byte, int, error) {
Expand Down Expand Up @@ -50,7 +51,7 @@ func BuildTree(buf io.Reader, chunkSize int64) ([]byte, []byte, [][]byte, int, e

r := tree.Root()

exportedTree, err := tree.Export()
exportedTree, err := json.Marshal(tree)
if err != nil {
return nil, nil, nil, 0, err
}
Expand Down

0 comments on commit 6bdaffb

Please sign in to comment.