Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
petar committed Aug 5, 2020
1 parent 18a2756 commit 9dc4917
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cmd/ipfs/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

const (
algorithmDefault = options.RSAKey
algorithmDefault = options.Ed25519Key
algorithmOptionName = "algorithm"
bitsOptionName = "bits"
emptyRepoOptionName = "empty-repo"
Expand Down
2 changes: 1 addition & 1 deletion core/commands/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
Expand Down
12 changes: 6 additions & 6 deletions test/sharness/t0020-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'
Expand Down Expand Up @@ -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
'
Expand All @@ -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" '
Expand All @@ -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" '
Expand Down Expand Up @@ -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" '
Expand Down
2 changes: 1 addition & 1 deletion test/sharness/t0022-init-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'

Expand Down
2 changes: 1 addition & 1 deletion test/sharness/t0025-datastores.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" '
Expand Down
3 changes: 2 additions & 1 deletion test/sharness/t0160-resolve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ test_expect_success "resolve: prepare dag" '
'

test_expect_success "resolve: prepare keys" '
self_hash=$(ipfs id -f="<id>") &&
# self_hash=$(ipfs id -f="<id>") &&
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)
'

Expand Down

0 comments on commit 9dc4917

Please sign in to comment.