starknet-io / starknet.js

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

Report of WalletAccounts tests #1060

Open PhilippeR26 opened 5 months ago

PhilippeR26 commented 5 months ago

Context

I have ended the tests of WalletAccount . I have some comments :

About automatic change of account, the re-initialization of cairoVersion is missing here https://github.com/starknet-io/starknet.js/blob/4b839432e16c61e270e140dec9399c1f09a7d38b/src/wallet/account.ts#L55. About automatic change of chain, the change of this.chainId without changing the nodeurl is generating a complete mess in the DAPP. I think that if the DAPP accepts to change of chain, it has to propose a Rpc provider for each chain accepted. So, in this spirit, it will be the responsibility of the DAPP to convert a new chainId to a new Rpc provider. I think it will be important in the case of layer 3. So, we could delete setChainId, and replace it by something accepting the RpcProviderOptions as input.

Also one little thing, about the access to the frontend provider : if the DAPP wants to do something with the provider in use in the Wallet Account, it needs :

const txR = await myWalletAccount?.channel.waitForTransaction(txH);

Normally, channel should be hidden to the DAPP devs. Couldn't we have something like :

const txR = await myWalletAccount?.provider.waitForTransaction(txH);

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

EjembiEmmanuel commented 5 months ago

@PhilippeR26 I'll like to work on this

PhilippeR26 commented 5 months ago

Hello, I think it's already handled by core team (@ivpavici )

PhilippeR26 commented 3 months ago

@tabaktoni I have a strange error when using WalletAccount.deployAccount() :

Error: Expected valid bigint: 0 < bigint < curve.n

I think that you should override deployAccount method, using UDC.

PhilippeR26 commented 3 months ago

Following the last commits of the Wallet API, 2 things have to be implemented :

[!WARNING] Currently not open to contributors.

ivpavici commented 2 months ago

@PhilippeR26 can we close this?

PhilippeR26 commented 2 months ago

If you consider that all identified problems are solved, or are minor, or will be solved later, you can close. Personally, I think that @tabaktoni should dig a little in these subjects.