Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #535 from jimni1222/conformance
Browse files Browse the repository at this point in the history
Allows not define key when does not have to
  • Loading branch information
jimni1222 authored Oct 19, 2021
2 parents 786bb48 + 53a9ddb commit f362f68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/caver-core-helpers/src/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ const inputAccountKeyFormatter = function(accountKey) {
return { keyType: 5, key }
}

if (accountKey.keyType === undefined || accountKey.key === undefined) {
const keyTypesWithoutKeyDefinition = [1, 3] // AccountKeyLegacy, AccountKeyFail
if (accountKey.keyType === undefined || (accountKey.key === undefined && !keyTypesWithoutKeyDefinition.includes(accountKey.keyType))) {
throw new Error(`AccountKey obejct should define 'keyType' and 'key'`)
}

Expand Down

0 comments on commit f362f68

Please sign in to comment.