diff --git a/provers/mock/prover.go b/provers/mock/prover.go index c5aecac8..3be2ebfd 100644 --- a/provers/mock/prover.go +++ b/provers/mock/prover.go @@ -3,8 +3,8 @@ package mock import ( "context" "crypto/sha256" + "encoding/binary" fmt "fmt" - "math/big" "time" "github.com/cosmos/cosmos-sdk/codec" @@ -126,19 +126,16 @@ func makeProof(height exported.Height, path string, bz []byte) []byte { revisionNumber := height.GetRevisionNumber() revisionHeight := height.GetRevisionHeight() - heightBig := new(big.Int) - revisionNumberBig := new(big.Int).SetUint64(revisionNumber) - revisionNumberBig = revisionNumberBig.Lsh(revisionNumberBig, 64) - revisionHeightBig := new(big.Int).SetUint64(revisionHeight) - heightBig.Or(revisionNumberBig, revisionHeightBig) - hashHeight := sha256.Sum256(heightBig.Bytes()) + heightBuf := make([]byte, 16) + binary.LittleEndian.PutUint64(heightBuf[:8], revisionHeight) + binary.LittleEndian.PutUint64(heightBuf[8:], revisionNumber) hashPrefix := sha256.Sum256(core.DefaultChainPrefix.Bytes()) hashPath := sha256.Sum256([]byte(path)) hashValue := sha256.Sum256([]byte(bz)) var combined []byte - combined = append(combined, hashHeight[:]...) + combined = append(combined, heightBuf...) combined = append(combined, hashPrefix[:]...) combined = append(combined, hashPath[:]...) combined = append(combined, hashValue[:]...) diff --git a/tests/chains/tendermint/go.mod b/tests/chains/tendermint/go.mod index bdfd19d0..6c724630 100644 --- a/tests/chains/tendermint/go.mod +++ b/tests/chains/tendermint/go.mod @@ -168,6 +168,6 @@ require ( replace ( // https://github.com/cosmos/cosmos-sdk/blob/v0.47.3/go.mod#L171-L182 github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/datachainlab/ibc-mock-client => github.com/dongrie/ibc-mock-client v0.3.3-0.20231213015729-29b70e76baf2 + github.com/datachainlab/ibc-mock-client => github.com/dongrie/ibc-mock-client v0.3.3-0.20231221102347-9000a7df65b4 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) diff --git a/tests/chains/tendermint/go.sum b/tests/chains/tendermint/go.sum index 9a164fb1..3f25ca68 100644 --- a/tests/chains/tendermint/go.sum +++ b/tests/chains/tendermint/go.sum @@ -370,8 +370,8 @@ github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WA github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/dongrie/ibc-mock-client v0.3.3-0.20231213015729-29b70e76baf2 h1:wuqyTnekH+pfNr+0Nrfq6PJgvllBbr7brabygF7oLlM= -github.com/dongrie/ibc-mock-client v0.3.3-0.20231213015729-29b70e76baf2/go.mod h1:FfqyF+VJKp8jlIG21lTNJJIp8RCaxSrx6vjhNkfwgBM= +github.com/dongrie/ibc-mock-client v0.3.3-0.20231221102347-9000a7df65b4 h1:6Ons8oPPMxqjPpcIRan7duWpyjVBnOR6S2u0iiTIBWk= +github.com/dongrie/ibc-mock-client v0.3.3-0.20231221102347-9000a7df65b4/go.mod h1:FfqyF+VJKp8jlIG21lTNJJIp8RCaxSrx6vjhNkfwgBM= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=