Skip to content

Conversation

@chfanghr
Copy link
Contributor

@chfanghr chfanghr commented Oct 7, 2023

Forbid the use of exceptions with the help of fp-ts's TaskEither. Base on #2.

@chfanghr chfanghr requested a review from adamczykm October 7, 2023 05:16
@chfanghr chfanghr changed the base branch from develop to connor/simple-password-tree-root-update October 7, 2023 05:18
@chfanghr chfanghr force-pushed the connor/dyn-plugins branch 2 times, most recently from 80ed5d0 to 173200b Compare October 9, 2023 09:39
Copy link
Contributor

@adamczykm adamczykm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamczykm
Copy link
Contributor

Additionally, please, as always, add comments or even more beautiful documentation, we will need to do it anyway. Soon. Also they provide a lot of value and are cheap to produce.

@chfanghr chfanghr force-pushed the connor/dyn-plugins branch 2 times, most recently from 796859a to 7e94291 Compare October 10, 2023 19:10
fix npm run scripts

fix plugin loading

fix custom route installation

fix inconsistent log messages

compatible with standard ts
@chfanghr chfanghr marked this pull request as ready for review October 10, 2023 19:58
@chfanghr chfanghr changed the title Support dynamic plugin loading Support dynamic plugin loading; Fp implementation with Ts compatibility; Mechanisms to revoke authorizations(#6) Oct 11, 2023
@chfanghr chfanghr requested a review from adamczykm October 12, 2023 09:43
(r) => T.fromIO(() => res.status(200).json(r))
)
),
T.map(() => {})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, if you write out the type of the resulting lambda it would be (_: TaskEither<string, Express>): TaskEither<string, void>.

// `${this.cfg.baseUrl}/getWitness/${treeRoot
// .toBigInt()
// .toString()}/${leafIndex.toString()}`;
// fetchPublicInputs(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is left commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's from the previously pr: #2 (comment)

Copy link
Contributor

@adamczykm adamczykm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will use a second-hand opinion on whether to ban the fp-ts usage.
It is not worth it in my opinion.

The library slowly starts to be mainly about types and how to deal with them which obscures a functionality that in fact is quite simple. The introduction of the interface kind made it even worse.
Additionally the code lacks commentary, especially given how hard it is to read now.
If you compose pipe operations in a foldleft and recurse, that is something that begs for a little bit of explanation of what is going on.

I'm sorry I don't know what to do with this PR.

async (tree: TreeStorage) => {
const leaves = A.map(O.toUndefined)(await tree.getLeaves());

// '/getWitness/:treeRoot/:leafIndex': (req, resp): Promise<void> => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

this.storageProvider.getTree(treeRoot),
TE.chain(
TE.fromOption(
() => `tree with root ${treeRoot.toString()} missing`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The amount of code bloat that the library generates is enormous.

@adamczykm adamczykm merged commit 90b4cd1 into connor/simple-password-tree-root-update Oct 13, 2023
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

Successfully merging this pull request may close these issues.

3 participants