Closed khanti42 closed 1 week ago
Issues
6 New issues
0 Accepted issues
Measures
0 Security Hotspots
71.0% Coverage on New Code
1.3% Duplication on New Code
Issues
1 New issue
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
12.0% Duplication on New Code
Description: This PR closes #281. It introduces several enhancements and fixes to the StarkNet Snap package. Key changes include:
Support for Cairo Legacy Versions:
CAIRO_VERSION_LEGACY
and related utilities.createAccount
function to handle both current and legacy Cairo versions, using thecairoVersion
parameter.Account Deployment Enhancements:
getCorrectContractAddress
function to include logic for detecting and handling non-deployed accounts with a non-zero balance.deployRequired
to theAccContract
type to track whether account deployment is needed.UI Updates:
DeployModal
component to guide users through deploying their accounts.App.tsx
to handle the display logic for the newDeployModal
.DeployModal
component for better UI development and testing.Redux State Management:
deployModalVisible
state for managing the visibility of the deployment modal.useStarkNetSnap
hook to handle the deployment flow and manage modal visibility accordingly.Test Coverage:
Files Changed:
createAccount.ts
: Updated to support Cairo legacy versions and added conditional logic for account creation.index.ts
: Added a new case forstarkNet_createAccountLegacy
.recoverAccounts.ts
: Added logic to determine if an account requires deployment.snapState.ts
: UpdatedAccContract
interface to includedeployRequired
.constants.ts
: Added constants for Cairo versions and hashes.starknetUtils.ts
: Added utility functions for deployment and fee estimation.constants.test.ts
: Added new test constants.recoverAccounts.test.ts
,upgradeAccContract.test.ts
,starknetUtils.test.ts
: Updated and added tests for new functionalities.App.tsx
,DeployModal.stories.tsx
,DeployModal.style.ts
,DeployModal.view.tsx
,DeployModal/index.ts
: UI updates for deployment modal. Created new DeployModal.useStarkNetSnap.ts
: Updated to manage deployment flow.modalSlice.ts
: AddeddeployModalVisible
state.index.ts
: UpdatedAccount
type to includedeployRequired
.PR Checklist:
Note: Ensure to review the new deployment flow and the UI changes introduced by the
DeployModal
component.