Skip to content

Comments

Reorg#1

Merged
notmandatory merged 7 commits intomasterfrom
reorg
May 17, 2023
Merged

Reorg#1
notmandatory merged 7 commits intomasterfrom
reorg

Conversation

@notmandatory
Copy link
Member

No description provided.

chain_code,
epubkey,
xcvc,
pub fn read(&mut self) -> Result<ReadResponse, Error> {
Copy link
Collaborator

@brh28 brh28 May 8, 2023

Choose a reason for hiding this comment

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

Thoughts on using different constructors to build the request objects. Example here:

pub fn read(&mut self) -> Result<ReadResponse, Error> {
        let read_cmd = ReadCommand::for_satscard(self.card_nonce.clone());
        let read_response = self.transport.transmit_read(read_cmd);
        if let Ok(read_response) = &response {
            self.card_nonce = read_response.card_nonce.clone();
        }
        response
    }
    ```

@notmandatory notmandatory marked this pull request as ready for review May 14, 2023 20:52
@notmandatory notmandatory self-assigned this May 14, 2023
@notmandatory notmandatory force-pushed the reorg branch 2 times, most recently from f783e89 to f23a698 Compare May 14, 2023 21:01
@notmandatory
Copy link
Member Author

Hey sorry for all the refactoring on top of your changes. But the process has been really helpful in finding a cleaner design. In the latest commit I added Authentication and SharedCommands traits which should consolidate most of the duplicated code and make it clear where new commands need to go. Shared commands that are called the same way for all the card types go in the SharedCommands trait, and the rest go in the specific impl for each card.

If this looks OK to you then I'll merge it. Adding the rest of the commands can go in new PRs.

Besides the remaining commands the other near-term TODOs I see are:

  • verify all all encrypted and/or signed response data
  • make an example CLI (using clap-rs) for easier manual testing

Copy link
Collaborator

@brh28 brh28 left a comment

Choose a reason for hiding this comment

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

LGTM. Gives some structure which should make development easier

@notmandatory notmandatory merged commit 1f47537 into master May 17, 2023
@notmandatory notmandatory deleted the reorg branch May 22, 2023 22:54
notmandatory pushed a commit that referenced this pull request Apr 21, 2025
Async Transport add `change` and `backup`
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