Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor the Maker code for expressivity #47

Open
jrayback opened this issue Jun 6, 2024 · 0 comments
Open

refactor the Maker code for expressivity #47

jrayback opened this issue Jun 6, 2024 · 0 comments

Comments

@jrayback
Copy link
Contributor

jrayback commented Jun 6, 2024

Something like the following is very expressive. But the return types between the functions in a pipe like this don't line up yet.

const returnRaw = (raw: Buffer) => (code: Code): Raw => ({ code, raw }) // would go in ../lib or something...

export const ecdsa256k1: Maker = (primitive: Buffer): Ecdsa256k1 => 
  pipe(
    primitive,
    makeSureThat(
      itIs33Bytes(primitive),
      prefixIs02or03(primitive)
    ),
    returnRaw('1AAB')
  )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant