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

[discuss] chore(connect): coinAbstractMethod #15304

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

mroz22
Copy link
Contributor

@mroz22 mroz22 commented Nov 7, 2024

I am exploring modularization possibilities. And it of course brings about many ideas for refactoring and improvements.
While thinking (#15291) about how to reduce the amount of data in config.ts - where specifically I don't like the information about feature support - IMHO it should be defined per coin-module.

Would it make sense to define common stuff and stuff like this in a coin specific abstract method? cc @marekrjpolak @karliatto @martykan

@mroz22 mroz22 force-pushed the connect-coin-abstract-method branch from 0af31c8 to 55450ea Compare November 7, 2024 14:34
Comment on lines +17 to +20
export default class BinanceGetAddress extends BinanceAbstractMethod<
'binanceGetAddress',
Params[]
> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

if I give it a shorter name + remove comments, I am optimistic that this might be a line saving solution :D

@martykan
Copy link
Member

martykan commented Nov 7, 2024

Yeah seems good. Also when I look at GetAddress, GetPublicKey init, it seems like it's mostly the same between all methods

this.firmwareRange = getFirmwareRange(this.name, getMiscNetwork('BNB'), this.firmwareRange);
}

// firmwareRangeRequirements could be defined here instead of config.ts
Copy link
Contributor Author

Choose a reason for hiding this comment

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

specifically firmwareRangeRequirement for coin. basically we have now 3 levels of fw requirements

  • coin
  • method
  • method feature

coin could be defined in this abstract method

@mroz22
Copy link
Contributor Author

mroz22 commented Nov 12, 2024

hmm, ti doesn't work very well, there could be <coinComposeTranaction> which is different (has firmware range, doesn't have unavailable capability because it has useDevice: false)

@mroz22 mroz22 force-pushed the connect-coin-abstract-method branch from 55450ea to d2178e1 Compare November 12, 2024 09:27
@mroz22 mroz22 force-pushed the connect-coin-abstract-method branch from d2178e1 to 2f80653 Compare November 12, 2024 09:28
Comment on lines +344 to +346
if (!this.useDevice) {
return true;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

if cardanoComposeTransaction, or any method that has useDevice: false should also inherit from a coin specific abstract method, we need to handle cases like this. I am starting to dislike it

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.

2 participants