mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
fix: ensure hasher is registered when using a hashing function
Fixes #9297
This commit is contained in:
parent
baccaef1b5
commit
773c246232
@ -210,6 +210,9 @@ See 'dag export' and 'dag import' for more information.
|
||||
if !ok {
|
||||
return fmt.Errorf("unrecognized hash function: %q", strings.ToLower(hashFunStr))
|
||||
}
|
||||
if _, err := mh.GetHasher(hashFunCode); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
enc, err := cmdenv.GetCidEncoder(req)
|
||||
if err != nil {
|
||||
|
||||
@ -93,6 +93,10 @@ EOF
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_expect_failure "'ipfs add' with an unregistered hash and wrapped leaves fails without crashing" '
|
||||
ipfs add --hash poseidon-bls12_381-a2-fc1 --raw-leaves=false -r mountdir/planets
|
||||
'
|
||||
|
||||
}
|
||||
|
||||
# should work offline
|
||||
|
||||
Loading…
Reference in New Issue
Block a user