Skip to content

Commit

Permalink
Release v0.11.1, using GoAmino v14
Browse files Browse the repository at this point in the history
  • Loading branch information
jaekwon committed Oct 29, 2018
1 parent 2a2e28b commit fa74114
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.11.1 (October 29, 2018)

IMPROVEMENTS

- Uses GoAmino v0.14

## 0.11.0 (September 7, 2018)

BREAKING CHANGES
Expand Down
12 changes: 6 additions & 6 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

[[constraint]]
name = "github.com/tendermint/go-amino"
version = "^0.12.0-rc0"
version = "v0.14.0"

[[constraint]]
name = "github.com/tendermint/tendermint"
version = "^v0.26.0-dev0"
version = "=v0.26.0-rc0"

[prune]
go-tests = true
Expand Down
4 changes: 2 additions & 2 deletions proof_iavl_absence.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ func IAVLAbsenceOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error) {
return nil, cmn.NewError("unexpected ProofOp.Type; got %v, want %v", pop.Type, ProofOpIAVLAbsence)
}
var op IAVLAbsenceOp // a bit strange as we'll discard this, but it works.
err := cdc.UnmarshalBinary(pop.Data, &op)
err := cdc.UnmarshalBinaryLengthPrefixed(pop.Data, &op)
if err != nil {
return nil, cmn.ErrorWrap(err, "decoding ProofOp.Data into IAVLAbsenceOp")
}
return NewIAVLAbsenceOp(pop.Key, op.Proof), nil
}

func (op IAVLAbsenceOp) ProofOp() merkle.ProofOp {
bz := cdc.MustMarshalBinary(op)
bz := cdc.MustMarshalBinaryLengthPrefixed(op)
return merkle.ProofOp{
Type: ProofOpIAVLAbsence,
Key: op.key,
Expand Down
4 changes: 2 additions & 2 deletions proof_iavl_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ func IAVLValueOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error) {
return nil, cmn.NewError("unexpected ProofOp.Type; got %v, want %v", pop.Type, ProofOpIAVLValue)
}
var op IAVLValueOp // a bit strange as we'll discard this, but it works.
err := cdc.UnmarshalBinary(pop.Data, &op)
err := cdc.UnmarshalBinaryLengthPrefixed(pop.Data, &op)
if err != nil {
return nil, cmn.ErrorWrap(err, "decoding ProofOp.Data into IAVLValueOp")
}
return NewIAVLValueOp(pop.Key, op.Proof), nil
}

func (op IAVLValueOp) ProofOp() merkle.ProofOp {
bz := cdc.MustMarshalBinary(op)
bz := cdc.MustMarshalBinaryLengthPrefixed(op)
return merkle.ProofOp{
Type: ProofOpIAVLValue,
Key: op.key,
Expand Down
8 changes: 4 additions & 4 deletions proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,21 +208,21 @@ func verifyProof(t *testing.T, proof *RangeProof, root []byte) {

// Write/Read then verify.
cdc := amino.NewCodec()
proofBytes := cdc.MustMarshalBinary(proof)
proofBytes := cdc.MustMarshalBinaryLengthPrefixed(proof)
var proof2 = new(RangeProof)
err := cdc.UnmarshalBinary(proofBytes, proof2)
err := cdc.UnmarshalBinaryLengthPrefixed(proofBytes, proof2)
require.Nil(t, err, "Failed to read KeyExistsProof from bytes: %v", err)

// Random mutations must not verify
for i := 0; i < 1e4; i++ {
badProofBytes := test.MutateByteSlice(proofBytes)
var badProof = new(RangeProof)
err := cdc.UnmarshalBinary(badProofBytes, badProof)
err := cdc.UnmarshalBinaryLengthPrefixed(badProofBytes, badProof)
if err != nil {
continue // couldn't even decode.
}
// re-encode to make sure it's actually different.
badProofBytes2 := cdc.MustMarshalBinary(badProof)
badProofBytes2 := cdc.MustMarshalBinaryLengthPrefixed(badProof)
if bytes.Equal(proofBytes, badProofBytes2) {
continue // didn't mutate successfully.
}
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package iavl

// Version of iavl.
const Version = "0.11.0"
const Version = "0.11.1"

0 comments on commit fa74114

Please sign in to comment.