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

feat: remove uuid dependency in favor of crypto.randomUUID() #1608

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/new-rats-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the changeset should not be empty since we are adding a new exportable helper on the crypto package and made changes on the wallet package.

Therefore we want to bump versions on these 2 packages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cbed7c4

I put crypto into the changeset because of the new export, but didn't put wallet because this is an internal change that doesn't change its functionality at all.

Copy link
Member

Choose a reason for hiding this comment

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

These packages are published independently.

We can't consider things as "internal" in this way.

The usual is to bump everything that will get a new published version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

6 changes: 1 addition & 5 deletions packages/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@
"@fuel-ts/errors": "workspace:*",
"ethers": "^6.7.1",
"portfinder": "^1.0.32",
"tree-kill": "^1.2.2",
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/uuid": "^9.0.1"
"tree-kill": "^1.2.2"
}
}
3 changes: 1 addition & 2 deletions packages/wallet/src/keystore-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
import { ErrorCode, FuelError } from '@fuel-ts/errors';
import type { AbstractAddress } from '@fuel-ts/interfaces';
import { hexlify } from 'ethers';
import { v4 as uuidv4 } from 'uuid';

export type KeystoreWallet = {
id: string;
Expand Down Expand Up @@ -90,7 +89,7 @@ export async function encryptKeystoreWallet(

// Construct keystore.
const keystore: KeystoreWallet = {
id: uuidv4(),
id: crypto.randomUUID(),
arboleya marked this conversation as resolved.
Show resolved Hide resolved
version: 3,
address: removeHexPrefix(ownerAddress.toHexString()),
crypto: {
Expand Down
16 changes: 0 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading