starknet-io / starknet.js

JavaScript library for StarkNet
https://www.starknetjs.com
MIT License
1.21k stars 706 forks source link

provider.txIdentifier error when used with txId optional parameter #1136

Closed PhilippeR26 closed 2 weeks ago

PhilippeR26 commented 1 month ago

Describe the bug There is a txIdentifier function in utils/provider : https://github.com/starknet-io/starknet.js/blob/66a5c0341eccfef0dcdf1312c15627b7d4f6b675/src/utils/provider.ts#L95-L101 I don't know what's exactly the purpose of this function, but if to try to use it with the parameter txId, an error occurs :

TypeError: Do not know how to serialize a BigInt
    at JSON.stringify (<anonymous>)
    at Object.txIdentifier (/home/edmond/Documents/starknet/starknet.js-workshop-typescript/node_modules/starknet/src/utils/provider.ts:97:34)

Of course, you can't stringify a BigNumberish...

To Reproduce

import { provider } from "starknet";
const result = provider.txIdentifier(undefined, 26n);

Expected behavior No Error.

Screenshots N/A

Desktop (please complete the following information):

Additional context

[!WARNING] Currently not open to contributors.

abdulsalamIshaq commented 1 month ago

I will like to be assigned to this @PhilippeR26

PhilippeR26 commented 1 month ago

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.

abdulsalamIshaq commented 1 month ago

Alright

Jemiiah commented 1 month ago

Okay will Iove to contribute to this project as well

PhilippeR26 commented 1 month ago

Please read just above.

Jemiiah commented 1 month ago

@PhilippeR26 how would we know when this issue have been accepted to be contributed on

tabaktoni commented 1 month ago

This it same as blockIdentifier but for Hash, And i think it was used os fix for diff for sequencer. anyway fix for this is to use json instead of JSON. json is injected with BN support. But I think we can now remove this function also formatHash also can be removed even comment mention feeder_gateway so 🧄