-
Notifications
You must be signed in to change notification settings - Fork 139
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
Transfer from starknet to starknet-kit #399
Conversation
davedumto
commented
Dec 17, 2024
There was a problem hiding this 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.
- Refactor wallet services for latest StarknetKit library - Improve error handling and connection logic - Update corresponding test suite
840c751
to
34ba412
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve comments.
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 |
@davedumto you should only remove |
@davedumto Any updates? |
I will be making a push shortly. |
087fb58
to
c11627c
Compare
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 |
…to migrate-test-suites-to-starknetkit
…om/davedumto/spotnet-ODHack into migrate-test-suites-to-starknetkit
Okay, that's fine, probably they use it as a peerDependency, however old |
There was a problem hiding this 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')
There was a problem hiding this 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)
There was a problem hiding this 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
frontend/.yarn/install-state.gz
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be commited
frontend/.yarnrc.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be commited
frontend/package-lock.json
Outdated
There was a problem hiding this comment.
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.
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 |
@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. |
@davedumto Any updates? |
I am working on it right now I'll make a push. I'm rounding up |
There was a problem hiding this 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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why tests were commented?
There was a problem hiding this comment.
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.
@davedumto Any updates? |
I am doing that about to push |
@davedumto any updates? |
…om/davedumto/spotnet-ODHack into migrate-test-suites-to-starknetkit
Please @djeck1432 kindly check the pushed changes. I deleted the commented code and I reimplemented the CallData function |
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove logs.
There was a problem hiding this comment.
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', () => { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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', () => { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unresolved.
}); | ||
|
||
describe('closePosition', () => { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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', () => { |
There was a problem hiding this comment.
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
There was a problem hiding this 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
@davedumto Please let me know if this happens only on my end and the whole flow and each function works for you?
There was a problem hiding this 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)
@davedumto Sorry, you didn't manage with this task, |