From 787cf0ebac0be52795f71082d5a9b446412fb219 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 21 Mar 2017 22:50:23 +0100 Subject: [PATCH] Update to patched go-p2p, tendermint, fix a few tests --- app/genesis_test.go | 2 +- cmd/commands/key.go | 7 ++++--- glide.lock | 4 ++-- plugins/ibc/ibc_test.go | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/genesis_test.go b/app/genesis_test.go index 74ca22e61..4fec4b6db 100644 --- a/app/genesis_test.go +++ b/app/genesis_test.go @@ -38,7 +38,7 @@ func TestLoadGenesis(t *testing.T) { assert.EqualValues("blank", acct.Balance[0].Denom) // and public key is parsed properly - apk := acct.PubKey.PubKey + apk := acct.PubKey.Unwrap() require.NotNil(apk) epk, ok := apk.(crypto.PubKeyEd25519) if assert.True(ok) { diff --git a/cmd/commands/key.go b/cmd/commands/key.go index 91678f625..b2674ca82 100644 --- a/cmd/commands/key.go +++ b/cmd/commands/key.go @@ -75,13 +75,14 @@ func (k *Key) Sign(msg []byte) crypto.Signature { // Generates a new validator with private key. func genKey() *Key { privKey := crypto.GenPrivKeyEd25519() - addrBytes := privKey.PubKey().Address() + pubKey := privKey.PubKey() + addrBytes := pubKey.Address() var addr Address copy(addr[:], addrBytes) return &Key{ Address: addr, - PubKey: crypto.PubKeyS{privKey.PubKey()}, - PrivKey: crypto.PrivKeyS{privKey}, + PubKey: pubKey, + PrivKey: privKey.Wrap(), } } diff --git a/glide.lock b/glide.lock index 579db86b7..493deda79 100644 --- a/glide.lock +++ b/glide.lock @@ -86,7 +86,7 @@ imports: - name: github.com/tendermint/go-merkle version: 714d4d04557fd068a7c2a1748241ce8428015a96 - name: github.com/tendermint/go-p2p - version: 17124989a93774833df33107fbf17157a7f8ef31 + version: a163fddbdd2541793d22402afb113e6ccb391774 subpackages: - upnp - name: github.com/tendermint/go-rpc @@ -107,7 +107,7 @@ imports: - app - client - name: github.com/tendermint/tendermint - version: 6bcd4242f1f336e2b2ef4f644fabaf56222b34d0 + version: 936e66867aecf92595b1f8615361b2867d9a69e6 subpackages: - blockchain - cmd/tendermint/commands diff --git a/plugins/ibc/ibc_test.go b/plugins/ibc/ibc_test.go index 9439f4378..4b220f189 100644 --- a/plugins/ibc/ibc_test.go +++ b/plugins/ibc/ibc_test.go @@ -30,7 +30,7 @@ func genGenesisDoc(chainID string, numVals int) (*tm.GenesisDoc, []types.PrivAcc name := cmn.Fmt("%v_val_%v", chainID, i) privAcc := types.PrivAccountFromSecret(name) genDoc.Validators = append(genDoc.Validators, tm.GenesisValidator{ - PubKey: privAcc.PubKey.PubKey, + PubKey: privAcc.PubKey, Amount: 1, Name: name, }) @@ -268,9 +268,9 @@ func TestIBCPluginBadCommit(t *testing.T) { // Update a chain with a broken commit // Modify the first byte of the first signature - sig := commit.Precommits[0].Signature.(crypto.SignatureEd25519) + sig := commit.Precommits[0].Signature.Unwrap().(crypto.SignatureEd25519) sig[0] += 1 - commit.Precommits[0].Signature = sig + commit.Precommits[0].Signature = crypto.WrapSignature(sig) res = ibcPlugin.RunTx(store, ctx, wire.BinaryBytes(struct{ IBCTx }{IBCUpdateChainTx{ Header: header, Commit: commit,