From 9dc49174adcb669b267937422e7ab4327e032978 Mon Sep 17 00:00:00 2001 From: Petar Maymounkov Date: Wed, 5 Aug 2020 09:09:01 -0700 Subject: [PATCH] commit --- cmd/ipfs/init.go | 2 +- core/commands/keystore.go | 2 +- test/sharness/t0020-init.sh | 12 ++++++------ test/sharness/t0022-init-default.sh | 2 +- test/sharness/t0025-datastores.sh | 2 +- test/sharness/t0160-resolve.sh | 3 ++- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index 4359c19a712..40ef7909fe3 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -23,7 +23,7 @@ import ( ) const ( - algorithmDefault = options.RSAKey + algorithmDefault = options.Ed25519Key algorithmOptionName = "algorithm" bitsOptionName = "bits" emptyRepoOptionName = "empty-repo" diff --git a/core/commands/keystore.go b/core/commands/keystore.go index a50ee0b4f3c..aced55062a3 100644 --- a/core/commands/keystore.go +++ b/core/commands/keystore.go @@ -75,7 +75,7 @@ var keyGenCmd = &cmds.Command{ Tagline: "Create a new keypair", }, Options: []cmds.Option{ - cmds.StringOption(keyStoreTypeOptionName, "t", "type of the key to create: rsa, ed25519").WithDefault("rsa"), + cmds.StringOption(keyStoreTypeOptionName, "t", "type of the key to create: rsa, ed25519").WithDefault("ed25519"), cmds.IntOption(keyStoreSizeOptionName, "s", "size of the key to generate"), cmds.StringOption(keyFormatOptionName, "f", "output format: b58mh or b36cid").WithDefault("b58mh"), }, diff --git a/test/sharness/t0020-init.sh b/test/sharness/t0020-init.sh index e73b0562ec3..2cabe3d8f75 100755 --- a/test/sharness/t0020-init.sh +++ b/test/sharness/t0020-init.sh @@ -138,7 +138,7 @@ test_ipfs_init_flags() { ipfs init --algorithm=ed25519 --empty-repo >actual_init ;; *) - ipfs init --bits="$RSA_BITS" --empty-repo >actual_init + ipfs init --empty-repo >actual_init ;; esac ' @@ -166,7 +166,7 @@ test_ipfs_init_flags() { test_cmp ed25519_expected actual_init ;; *) - test_cmp rsa_expected actual_init + test_cmp ed25519_expected actual_init ;; esac ' @@ -190,14 +190,14 @@ test_ipfs_init_flags '' # test init profiles test_expect_success "'ipfs init --profile' with invalid profile fails" ' RSA_BITS="2048" && - test_must_fail ipfs init --bits="$RSA_BITS" --profile=nonexistent_profile 2> invalid_profile_out + test_must_fail ipfs init --profile=nonexistent_profile 2> invalid_profile_out EXPECT="Error: invalid configuration profile: nonexistent_profile" && grep "$EXPECT" invalid_profile_out ' test_expect_success "'ipfs init --profile' succeeds" ' RSA_BITS="2048" && - ipfs init --bits="$RSA_BITS" --profile=server + ipfs init --profile=server ' test_expect_success "'ipfs config Swarm.AddrFilters' looks good" ' @@ -211,7 +211,7 @@ test_expect_success "clean up ipfs dir" ' test_expect_success "'ipfs init --profile=test' succeeds" ' RSA_BITS="2048" && - ipfs init --bits="$RSA_BITS" --profile=test + ipfs init --profile=test ' test_expect_success "'ipfs config Bootstrap' looks good" ' @@ -244,7 +244,7 @@ test_expect_success "clean up ipfs dir" ' test_expect_success "'ipfs init --profile=lowpower' succeeds" ' RSA_BITS="2048" && - ipfs init --bits="$RSA_BITS" --profile=lowpower + ipfs init --profile=lowpower ' test_expect_success "'ipfs config Discovery.Routing' looks good" ' diff --git a/test/sharness/t0022-init-default.sh b/test/sharness/t0022-init-default.sh index b51a44184e2..ff1e2d07ec0 100755 --- a/test/sharness/t0022-init-default.sh +++ b/test/sharness/t0022-init-default.sh @@ -16,7 +16,7 @@ test_expect_success "ipfs init succeeds" ' export IPFS_PATH="$(pwd)/.ipfs" && echo "IPFS_PATH: \"$IPFS_PATH\"" && BITS="2048" && - ipfs init --bits="$BITS" >actual_init || + ipfs init >actual_init || test_fsh cat actual_init ' diff --git a/test/sharness/t0025-datastores.sh b/test/sharness/t0025-datastores.sh index 63290d9fb01..ec99accb5e7 100755 --- a/test/sharness/t0025-datastores.sh +++ b/test/sharness/t0025-datastores.sh @@ -6,7 +6,7 @@ test_description="Test non-standard datastores" test_expect_success "'ipfs init --profile=badgerds' succeeds" ' BITS="2048" && - ipfs init --bits="$BITS" --profile=badgerds + ipfs init --profile=badgerds ' test_expect_success "'ipfs pin ls' works" ' diff --git a/test/sharness/t0160-resolve.sh b/test/sharness/t0160-resolve.sh index 6f63d6f31b3..14d8f611de0 100755 --- a/test/sharness/t0160-resolve.sh +++ b/test/sharness/t0160-resolve.sh @@ -22,7 +22,8 @@ test_expect_success "resolve: prepare dag" ' ' test_expect_success "resolve: prepare keys" ' - self_hash=$(ipfs id -f="") && + # self_hash=$(ipfs id -f="") && + self_hash=$(ipfs key list -f=b36cid -l | grep self | head -n 1 | cut -d " " -f1) alt_hash=$(ipfs key gen -f=b58mh -t rsa alt) '