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

Transfer from starknet to starknet-kit #399

Closed

Conversation

davedumto
Copy link
Contributor

Screenshot 2024-12-17 at 9 11 16 PM

@davedumto davedumto marked this pull request as ready for review December 17, 2024 21:39
Copy link
Collaborator

@whateverfw whateverfw left a comment

Choose a reason for hiding this comment

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

Please remove both starknet and get-starknet libraries from the project.

Also, for now it seems like that mostly you've just changed import statements, but not actually adjusted our functionality for new startknetkit library API. Because currently it fails right away at the startup point, when I try to connect a wallet. Please make sure you went through whole flow of connecting a wallet, creating a position, etc. etc. and make sure everything works well and adjusted for new library.

Also, please fix all failing test cases.

package.json Show resolved Hide resolved
frontend/src/services/wallet.js Outdated Show resolved Hide resolved
frontend/src/services/transaction.js Show resolved Hide resolved
frontend/src/services/contract.js Outdated Show resolved Hide resolved
frontend/src/services/transaction.js Show resolved Hide resolved
@djeck1432 djeck1432 linked an issue Dec 18, 2024 that may be closed by this pull request
- Refactor wallet services for latest StarknetKit library
- Improve error handling and connection logic
- Update corresponding test suite
@davedumto davedumto force-pushed the migrate-test-suites-to-starknetkit branch from 840c751 to 34ba412 Compare December 18, 2024 21:41
Copy link
Collaborator

@whateverfw whateverfw left a comment

Choose a reason for hiding this comment

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

Please resolve comments.

frontend/.yarn/install-state.gz Outdated Show resolved Hide resolved
frontend/.yarnrc.yml Outdated Show resolved Hide resolved
package-lock.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
frontend/package.json Show resolved Hide resolved
frontend/package-lock.json Outdated Show resolved Hide resolved
package-lock.json Outdated Show resolved Hide resolved
@davedumto
Copy link
Contributor Author

after removing the package.json files, the checks stopped being successful. but when installed, all tests work perfectly and the starknet has been removed and the logic has been fixed with the functionality retained

@whateverfw
Copy link
Collaborator

whateverfw commented Dec 19, 2024

@davedumto you should only remove package.json from root folder, not from frontend. Does it fail when you remove package.json from root folder only?
For sure it will when you remove it from frontend, because it is important there.

@djeck1432
Copy link
Owner

@davedumto Any updates?

@davedumto
Copy link
Contributor Author

@davedumto Any updates?

I will be making a push shortly.

@davedumto davedumto force-pushed the migrate-test-suites-to-starknetkit branch from 087fb58 to c11627c Compare December 19, 2024 21:57
@davedumto
Copy link
Contributor Author

davedumto commented Dec 20, 2024

Please remove both starknet and get-starknet libraries from the project.

Also, for now it seems like that mostly you've just changed import statements, but not actually adjusted our functionality for new startknetkit library API. Because currently it fails right away at the startup point, when I try to connect a wallet. Please make sure you went through whole flow of connecting a wallet, creating a position, etc. etc. and make sure everything works well and adjusted for new library.

Also, please fix all failing test cases.

Hey, so there is a bit of an issue. I have tried to uninstall the starknet dependency but there are alot more files that depend on it that is why the checks do not pass whenever I make a push with the starknet dependency uninstalled. the app works just fine, starknetkit is being used in the files logic specified and they all work fine

@davedumto davedumto requested a review from whateverfw December 20, 2024 03:33
@whateverfw
Copy link
Collaborator

Please remove both starknet and get-starknet libraries from the project.
Also, for now it seems like that mostly you've just changed import statements, but not actually adjusted our functionality for new startknetkit library API. Because currently it fails right away at the startup point, when I try to connect a wallet. Please make sure you went through whole flow of connecting a wallet, creating a position, etc. etc. and make sure everything works well and adjusted for new library.
Also, please fix all failing test cases.

Hey, so there is a bit of an issue. I have tried to uninstall the starknet dependency but there are alot more files that depend on it that is why the checks do not pass whenever I make a push with the starknet dependency uninstalled. the app works just fine, starknetkit is being used in the files logic specified and they all work fine

Okay, that's fine, probably they use it as a peerDependency, however old get-starknet still should be removed.

Copy link
Collaborator

@whateverfw whateverfw left a comment

Choose a reason for hiding this comment

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

wallet.js:92 Error fetching token balances: TypeError: Cannot read properties of undefined (reading 'modalMode')
    at connect (starknetkit.js:5351:1)
    at getTokenBalances (wallet.js:79:1)
    at getBalances (wallet.js:119:1)
    at BalanceCards.jsx:26:1

got this issue on form page, when trying to fetch my wallet's balance. Wondering why it did not work for me, but you stated that all functionality worked on you side?

The same exact error happens when app enters and execute checkForCRMToken functionalitty (in case env variable is false). or try to deploy contract
contract.js:38 Error deploying contract: TypeError: Cannot read properties of undefined (reading 'modalMode')

Copy link
Collaborator

@whateverfw whateverfw left a comment

Choose a reason for hiding this comment

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

Actually I can't even click Submit on Form page, as it errors out, seems like it was incorrectly merged with main. Because handleTransaction error handling was modified and this function now accepts different amount of params and because it was merged incorrectly - app crashes. You should look up into main and correctly apply those changes to your branch, for handleTransaction in particular (setError doesn't exist anymore)

Copy link
Collaborator

@whateverfw whateverfw left a comment

Choose a reason for hiding this comment

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

Please, go through all flow by yourself in a browser using a wallet, because currently it seems like you haven't tested it as app crashes just after connecting a wallet. Previously it was crashing only on 1 step earlier, so only 1st step was fixed, but I see a lot of issues further. Thanks

Copy link
Collaborator

Choose a reason for hiding this comment

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

should not be commited

Copy link
Collaborator

Choose a reason for hiding this comment

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

should not be commited

Copy link
Collaborator

Choose a reason for hiding this comment

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

shuld be removed, use yarn.

@davedumto
Copy link
Contributor Author

Please, go through all flow by yourself in a browser using a wallet, because currently it seems like you haven't tested it as app crashes just after connecting a wallet. Previously it was crashing only on 1 step earlier, so only 1st step was fixed, but I see a lot of issues further. Thanks

Okay so I think I know where the problem is, the only flow I paid attention to was that of Linking the wallet. Let me follow the flow and then debug

@whateverfw
Copy link
Collaborator

whateverfw commented Dec 20, 2024

@davedumto Yes, please test position opening on form page and closing (redeem) on dashboard page as well. Basically every piece of functionality should be tested as we change a library.

@djeck1432
Copy link
Owner

@davedumto Any updates?
3 days past, tomorrow last day to fix everything and merge it, otherwise you will get partially reward

@davedumto
Copy link
Contributor Author

@davedumto Any updates?

3 days past, tomorrow last day to fix everything and merge it, otherwise you will get partially reward

I am working on it right now I'll make a push. I'm rounding up

@djeck1432 djeck1432 changed the title test suites migration Transfer from starknet to starknet-kit Dec 21, 2024
Copy link
Collaborator

@whateverfw whateverfw left a comment

Choose a reason for hiding this comment

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

Please sync with main and resolve comments

@@ -17,27 +13,29 @@ export async function sendTransaction(loopLiquidityData, contractAddress) {
throw new Error('Missing or invalid loop_liquidity_data fields');
}
console.log(loopLiquidityData);
let approveCalldata = new CallData(erc20abi);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please bring back this CallData functionality as we anyway will keep starknet library?

Copy link
Collaborator

Choose a reason for hiding this comment

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

why tests were commented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the logic. I will delete the commented ones and push.

@djeck1432
Copy link
Owner

@davedumto Any updates?
Please, resolve merge conflict

@davedumto
Copy link
Contributor Author

@davedumto Any updates? Please, resolve merge conflict

I am doing that about to push

@djeck1432
Copy link
Owner

@davedumto any updates?

@davedumto
Copy link
Contributor Author

Please @djeck1432 kindly check the pushed changes. I deleted the commented code and I reimplemented the CallData function

@davedumto davedumto requested a review from whateverfw December 21, 2024 21:29
frontend/.yarn/install-state.gz Outdated Show resolved Hide resolved
frontend/.yarnrc.yml Outdated Show resolved Hide resolved
frontend/package-lock.json Outdated Show resolved Hide resolved
frontend/package.json Outdated Show resolved Hide resolved
let approveCalldata = new CallData(erc20abi);
const approveTransaction = {
contractAddress: loopLiquidityData.deposit_data.token,
entrypoint: 'approve',
calldata: approveCalldata.compile('approve', [contractAddress, loopLiquidityData.deposit_data.amount]),
};
console.log(loopLiquidityData)

console.log(loopLiquidityData);
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove logs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

unresolved

@@ -20,51 +22,6 @@ describe('Contract Deployment Tests', () => {
});
});

describe('deployContract', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you must not deleted tests. it should be the same amount as we have in main now, I see 8 less

Copy link
Collaborator

Choose a reason for hiding this comment

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

unresolved

delete process.env.REACT_APP_BACKEND_URL;
});

describe('sendTransaction', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you must not deleted tests. it should be the same amount as we have in main now, I see 8 less

Copy link
Collaborator

Choose a reason for hiding this comment

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

unresolved.

});

describe('closePosition', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you must not deleted tests. it should be the same amount as we have in main now, I see 8 less

Copy link
Collaborator

Choose a reason for hiding this comment

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

unresolved, you have function closePosition, but I don't see a test for it.

});
});

describe('getTokenBalances', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you must not deleted tests. it should be the same amount as we have in main now, I see 8 less

package-lock.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@whateverfw whateverfw left a comment

Choose a reason for hiding this comment

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

I can't open a new position

image

I can't close position
image

@davedumto Please let me know if this happens only on my end and the whole flow and each function works for you?

Copy link
Collaborator

@whateverfw whateverfw left a comment

Choose a reason for hiding this comment

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

each service function should have corresponding test case (just like before)

@djeck1432
Copy link
Owner

@davedumto Sorry, you didn't manage with this task,
time is over, a lot of comments not resolved, I couldn't connect to wallet, PR will be closed you will be unassigned

@djeck1432 djeck1432 closed this Dec 22, 2024
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.

[Frontend] Change library for connection to wallets
3 participants