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

Impossible to use computeHintedClassHash hash function #1135

Closed
PhilippeR26 opened this issue May 28, 2024 · 3 comments
Closed

Impossible to use computeHintedClassHash hash function #1135

PhilippeR26 opened this issue May 28, 2024 · 3 comments
Labels
Type: bug Something isn't working

Comments

@PhilippeR26
Copy link
Collaborator

PhilippeR26 commented May 28, 2024

Describe the bug
In utils/hash, the computeHintedClassHash() function is set a default export :

export default function computeHintedClassHash(compiledContract: LegacyCompiledContract) {

As a Starknet.js library user, I am not able to import and use this function.
Error message :

TSError: ⨯ Unable to compile TypeScript:
src/tmp/26.testSepolia.ts:33:25 - error TS2551: Property 'computeHintedClassHash' does not exist on type 'typeof index$1'. Did you mean 'computeCompiledClassHash'?

33     const result = hash.computeHintedClassHash()
                           ~~~~~~~~~~~~~~~~~~~~~~

To Reproduce
In a ts-node script :

import { hash } from "starknet";
const result = hash.computeHintedClassHash();

Expected behavior
To be able to use this function.

Screenshots
N/A
Desktop (please complete the following information):

  • Browser & version [e.g. chrome, safari, webworker] : any
  • Node version [e.g. 16.0.1] : ts-node@10.9.2
  • Starknet.js version : v6.9.0
  • Network [devnet, testnet]: any

Additional context

Warning

Currently not open to contributors.

@PhilippeR26 PhilippeR26 added the Type: bug Something isn't working label May 28, 2024
@PhilippeR26 PhilippeR26 mentioned this issue May 28, 2024
4 tasks
@martinvibes
Copy link

@PhilippeR26 can i hop on this?

@PhilippeR26
Copy link
Collaborator Author

Not yet.
I am creating today several issues, that have to be first discussed internally.
The team will then decide if it will be solved internally or with contributors.

@tabaktoni
Copy link
Collaborator

FIx:
Add into starknet.js/src/utils/hash/index.ts

export { default as computeHintedClassHash } from './classHash';

But I don't think we need to have default export anyway, so just remove default, run test if all ok resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants