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: replace models/keys with lumos hd #3152

Merged
merged 7 commits into from
May 15, 2024
Merged

refactor: replace models/keys with lumos hd #3152

merged 7 commits into from
May 15, 2024

Conversation

twhy
Copy link
Contributor

@twhy twhy commented May 15, 2024

@ckb-lumos/hd requires HexString for PublicKey, Privatekey, ChainCode, otherwise an error is thrown.

function assertHexString(debugPath: string, str: string): void {
  if (!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(str)) {
    throw new Error(`${debugPath} must be a hex string!`);
  }
}

@yanguoyu yanguoyu requested a review from silySuper May 15, 2024 06:56
Copy link
Collaborator

@homura homura left a comment

Choose a reason for hiding this comment

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

I found several instances of 0x${...} in this PR. We should avoid mixing HexString and HexStringWithout0x in one project, as this can lead to unpredictable behavior

packages/neuron-wallet/src/controllers/wallets.ts Outdated Show resolved Hide resolved
packages/neuron-wallet/tests/services/tx-wallet.test.ts Outdated Show resolved Hide resolved
packages/neuron-wallet/src/services/transaction-sender.ts Outdated Show resolved Hide resolved
@Keith-CY Keith-CY added this pull request to the merge queue May 15, 2024
Merged via the queue into nervosnetwork:develop with commit b8bad46 May 15, 2024
9 checks passed
@twhy twhy deleted the replace-keys-with-lumos-hd branch May 15, 2024 12:42
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