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

chore: fix types #321

Merged
merged 4 commits into from
Apr 16, 2021
Merged

chore: fix types #321

merged 4 commits into from
Apr 16, 2021

Conversation

achingbrain
Copy link
Member

  • Remove bignumber.js in favour of BigInt
  • Use ipld-block in favour of the old ipfs-core-types
  • Use blockstore from ipfs-repo instead of the old ipfs-core-types

- Remove bignumber.js in favour of BigInt
- Use ipld-block in favour of the old ipfs-core-types
- Use blockstore from ipfs-repo instead of the old ipfs-core-types
Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

LGTM
Couple of nits in review

package.json Outdated
"cids": "^1.1.6",
"debug": "^4.2.0",
"ipfs-core-types": "^0.3.1",
"ipfs-core-types": "next",
Copy link
Member

Choose a reason for hiding this comment

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

we need to get rid of these circular dependencies

Copy link
Member Author

@achingbrain achingbrain Apr 16, 2021

Choose a reason for hiding this comment

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

I don't think this is even required now, since we can pull the Blockstore type from ipfs-repo it's only in the tests, and even then it was only being used to pull types for the repo, which are in ipfs-repo now so it can go.

@@ -41,15 +34,12 @@ class WantListEntry {
}

/**
* @param {API} other
* @returns {boolean}
* @param {any} other
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @param {any} other
* @param {unknown} other

We are using unknown for such scenarios in libp2p. Perhaps better?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think you can access properties of a variable of type unknown?

Copy link
Member

Choose a reason for hiding this comment

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

@@ -6,7 +6,7 @@ const uint8ArrayEquals = require('uint8arrays/equals')
/**
* Creates a logger for the given subsystem
*
* @param {import('peer-id')} [id]
* @param {any} [id]
Copy link
Member

Choose a reason for hiding this comment

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

can this be other than PeerID?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, left that in by accident - I was toying with the idea of using CIDs instead of PeerIds

@achingbrain achingbrain merged commit 82c8935 into master Apr 16, 2021
@achingbrain achingbrain deleted the chore/fix-types branch April 16, 2021 13:57
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