Browse Source

Fixed imports

pull/1782/head
Ethan Frey 7 years ago
parent
commit
ac841a6124
4 changed files with 51 additions and 33 deletions
  1. +25
    -5
      glide.lock
  2. +7
    -0
      glide.yaml
  3. +1
    -1
      keys/keybase.go
  4. +18
    -27
      keys/keybase_test.go

+ 25
- 5
glide.lock View File

@ -1,5 +1,5 @@
hash: 6e06a42eafe0aeff112cee86aef6b2cab0e2f62c2e6bfccfb629aa22f6b62773
updated: 2017-10-27T18:45:18.350198941+02:00
hash: 86d02329c537ccb46ccb062918f0cb9e839f2cf894dfd57223c3ea4de14266db
updated: 2017-11-02T14:09:11.208038182-05:00
imports:
- name: github.com/btcsuite/btcd
version: c7588cbf7690cd9f047a28efa2dcd8f2435a4e5e
@ -29,29 +29,49 @@ imports:
version: 71201497bace774495daed26a3874fd339e0b538
- name: github.com/go-stack/stack
version: 817915b46b97fd7bb80e8ab6b69f01a53ac3eebf
- name: github.com/golang/snappy
version: 553a641470496b2327abcac10b36396bd98e45c9
- name: github.com/howeyc/crc16
version: 96a97a1abb579c7ff1a8ffa77f2e72d1c314b57f
- name: github.com/jmhodges/levigo
version: c42d9e0ca023e2198120196f842701bb4c55d7b9
- name: github.com/kr/logfmt
version: b84e30acd515aadc4b783ad4ff83aff3299bdfe0
- name: github.com/pkg/errors
version: 645ef00459ed84a119197bfb8d8205042c6df63d
- name: github.com/syndtr/goleveldb
version: b89cc31ef7977104127d34c1bd31ebd1a9db2199
subpackages:
- leveldb
- leveldb/cache
- leveldb/comparer
- leveldb/errors
- leveldb/filter
- leveldb/iterator
- leveldb/journal
- leveldb/memdb
- leveldb/opt
- leveldb/storage
- leveldb/table
- leveldb/util
- name: github.com/tendermint/ed25519
version: d8387025d2b9d158cf4efb07e7ebf814bcce2057
subpackages:
- edwards25519
- extra25519
- name: github.com/tendermint/go-wire
version: 8ee84b5b2581530168daf66fc89c548d27403c57
version: 2baffcb6b690057568bc90ef1d457efb150b979a
subpackages:
- data
- data/base58
- name: github.com/tendermint/tmlibs
version: 092eb701c7276907cdbed258750e22ce895b6735
version: d9525c0fb671204450b160807480e1263053fb20
subpackages:
- common
- db
- log
- name: golang.org/x/crypto
version: edd5e9b0879d13ee6970a50153d85b8fec9f7686
version: bd6f299fb381e4c3393d1c4b1f0b94f5e77650c8
subpackages:
- bcrypt
- blowfish


+ 7
- 0
glide.yaml View File

@ -6,6 +6,13 @@ import:
- package: github.com/btcsuite/btcutil
subpackages:
- base58
- package: github.com/syndtr/goleveldb
subpackages:
- leveldb
- leveldb/errors
- leveldb/iterator
- leveldb/opt
- leveldb/util
- package: github.com/tendermint/ed25519
subpackages:
- extra25519


+ 1
- 1
keys/keybase.go View File

@ -1,4 +1,4 @@
package cryptostore
package keys
import (
"strings"


+ 18
- 27
keys/keybase_test.go View File

@ -1,4 +1,4 @@
package cryptostore_test
package keys_test
import (
"bytes"
@ -10,11 +10,10 @@ import (
"github.com/stretchr/testify/require"
cmn "github.com/tendermint/tmlibs/common"
dbm "github.com/tendermint/tmlibs/db"
crypto "github.com/tendermint/go-crypto"
"github.com/tendermint/go-crypto/keys"
"github.com/tendermint/go-crypto/keys/cryptostore"
"github.com/tendermint/go-crypto/keys/storage/memstorage"
"github.com/tendermint/go-crypto/nano"
)
@ -23,9 +22,8 @@ func TestKeyManagement(t *testing.T) {
assert, require := assert.New(t), require.New(t)
// make the storage with reasonable defaults
cstore := cryptostore.New(
cryptostore.SecretBox,
memstorage.New(),
cstore := keys.New(
dbm.NewMemDB(),
keys.MustLoadCodec("english"),
)
@ -92,9 +90,8 @@ func TestSignVerify(t *testing.T) {
assert, require := assert.New(t), require.New(t)
// make the storage with reasonable defaults
cstore := cryptostore.New(
cryptostore.SecretBox,
memstorage.New(),
cstore := keys.New(
dbm.NewMemDB(),
keys.MustLoadCodec("english"),
)
algo := crypto.NameSecp256k1
@ -164,9 +161,8 @@ func TestSignWithLedger(t *testing.T) {
}
// make the storage with reasonable defaults
cstore := cryptostore.New(
cryptostore.SecretBox,
memstorage.New(),
cstore := keys.New(
dbm.NewMemDB(),
keys.MustLoadCodec("english"),
)
n := "nano-s"
@ -206,7 +202,7 @@ func TestSignWithLedger(t *testing.T) {
assert.False(key.VerifyBytes(d1, s2.Signature))
}
func assertPassword(assert *assert.Assertions, cstore cryptostore.Manager, name, pass, badpass string) {
func assertPassword(assert *assert.Assertions, cstore keys.KeyBase, name, pass, badpass string) {
err := cstore.Update(name, badpass, pass)
assert.NotNil(err)
err = cstore.Update(name, pass, pass)
@ -218,13 +214,12 @@ func TestImportUnencrypted(t *testing.T) {
require := require.New(t)
// make the storage with reasonable defaults
cstore := cryptostore.New(
cryptostore.SecretBox,
memstorage.New(),
cstore := keys.New(
dbm.NewMemDB(),
keys.MustLoadCodec("english"),
)
key, err := cryptostore.GenEd25519.Generate(cmn.RandBytes(16))
key, err := keys.GenEd25519.Generate(cmn.RandBytes(16))
require.NoError(err)
addr := key.PubKey().Address()
@ -246,9 +241,8 @@ func TestAdvancedKeyManagement(t *testing.T) {
assert, require := assert.New(t), require.New(t)
// make the storage with reasonable defaults
cstore := cryptostore.New(
cryptostore.SecretBox,
memstorage.New(),
cstore := keys.New(
dbm.NewMemDB(),
keys.MustLoadCodec("english"),
)
@ -290,9 +284,8 @@ func TestSeedPhrase(t *testing.T) {
assert, require := assert.New(t), require.New(t)
// make the storage with reasonable defaults
cstore := cryptostore.New(
cryptostore.SecretBox,
memstorage.New(),
cstore := keys.New(
dbm.NewMemDB(),
keys.MustLoadCodec("english"),
)
@ -322,10 +315,8 @@ func TestSeedPhrase(t *testing.T) {
func ExampleNew() {
// Select the encryption and storage for your cryptostore
cstore := cryptostore.New(
cryptostore.SecretBox,
// Note: use filestorage.New(dir) for real data
memstorage.New(),
cstore := keys.New(
dbm.NewMemDB(),
keys.MustLoadCodec("english"),
)
ed := crypto.NameEd25519


Loading…
Cancel
Save