forked from cardano-foundation/cardano-rosetta
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cardano-foundation#218 from input-output-hk/feat/2…
…05-construction-parse-staking-support Feat/205 construction parse staking support
- Loading branch information
Showing
7 changed files
with
412 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { PUBLIC_KEY_BYTES_LENGTH, AddressType } from './constants'; | ||
import { PUBLIC_KEY_BYTES_LENGTH, AddressType, CurveType } from './constants'; | ||
|
||
export const VALID_CURVE_TYPE = CurveType.edwards25519; | ||
|
||
export const isKeyValid = (publicKeyBytes: string, curveType: string): boolean => | ||
publicKeyBytes.length === PUBLIC_KEY_BYTES_LENGTH && curveType === 'edwards25519'; | ||
publicKeyBytes.length === PUBLIC_KEY_BYTES_LENGTH && curveType === CurveType.edwards25519; | ||
|
||
export const isAddressTypeValid = (type: string): boolean => | ||
[...Object.values(AddressType), '', undefined].includes(type); |
Oops, something went wrong.