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

Deleting a contract that is in GracPeriod is not handled correctly #463

Closed
mohamedamer453 opened this issue Jun 1, 2023 · 4 comments
Closed
Assignees
Labels
Milestone

Comments

@mohamedamer453
Copy link
Contributor

Description

Deleting a contract that is in GracPeriod is not handled correctly.

An error appears in the console mentioning that the fees to delete the contract is not enough but in the ui there's no error and it just keeps loading forever.

image

Expected Behavior

The contract shouldn't be deleted, and a clear error should be displayed to the user.

Steps to reproduce

  • Navigate to the contracts list.
  • Delete any contract in GracePeriod
@mohamedamer453 mohamedamer453 added type_bug Something isn't working playground labels Jun 1, 2023
@MohamedElmdary MohamedElmdary added this to the 2.1.0 milestone Jun 5, 2023
@MohamedElmdary MohamedElmdary moved this to In Progress in 3.11.x Jun 5, 2023
@0oM4R
Copy link
Contributor

0oM4R commented Jun 5, 2023

this error is happening while deleting the keys the client stucks on that error which leads to the btn to be loading forever,
tried to investigate and I think the issue occurred on

extrinsic.signAndSend(this.keypair, { nonce }, callback);

the callback is never called, and there is some logs

yarn run v1.22.19
$ /home/kassem/tfgrid-sdk-ts/node_modules/.bin/ts-node --project tsconfig-node.json scripts/name.ts
@polkadot/util has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
	cjs 10.4.2	node_modules/@polkadot/util/cjs
	cjs 9.7.2 	node_modules/@polkadot/rpc-provider/node_modules/@polkadot/util/cjs
Credentials not all found in env variables. Loading all credentials from default config.json...
2023-06-05 16:31:06        API/INIT: RPC methods not decorated: transaction_unstabale_submitAndWatch, transaction_unstable_unwatch
2023-06-05 16:31:06        API/INIT: Not decorating runtime apis without matching versions: TransactionPaymentApi/2 (1 known)
Validation succeed
Lock acquired
2023-06-05 16:31:08        RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1010: Invalid Transaction: Inability to pay some fees , e.g. account balance too low
2023-06-05 16:31:08             DRR: 1010: Invalid Transaction: Inability to pay some fees , e.g. account balance too low
2023-06-05 16:31:08        RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1010: Invalid Transaction: Inability to pay some fees , e.g. account balance too low
/home/kassem/tfgrid-sdk-ts/node_modules/@polkadot/rpc-provider/cjs/coder/index.js:34
    throw new _error.default(`${code}: ${message}${formatErrorData(data)}`, code, data);
          ^
RpcError: 1010: Invalid Transaction: Inability to pay some fees , e.g. account balance too low
    at checkError (/home/kassem/tfgrid-sdk-ts/node_modules/@polkadot/rpc-provider/cjs/coder/index.js:34:11)
    at RpcCoder.decodeResponse (/home/kassem/tfgrid-sdk-ts/node_modules/@polkadot/rpc-provider/cjs/coder/index.js:54:5)
    at WsProvider.value (/home/kassem/tfgrid-sdk-ts/node_modules/@polkadot/rpc-provider/cjs/ws/index.js:297:90)
    at W3CWebSocket.value [as onmessage] (/home/kassem/tfgrid-sdk-ts/node_modules/@polkadot/rpc-provider/cjs/ws/index.js:277:153)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/home/kassem/tfgrid-sdk-ts/node_modules/yaeti/lib/EventTarget.js:107:17)
    at W3CWebSocket.onMessage (/home/kassem/tfgrid-sdk-ts/node_modules/websocket/lib/W3CWebSocket.js:234:14)
    at WebSocketConnection.<anonymous> (/home/kassem/tfgrid-sdk-ts/node_modules/websocket/lib/W3CWebSocket.js:205:19)
    at WebSocketConnection.emit (node:events:513:28)
    at WebSocketConnection.emit (node:domain:489:12)
    at WebSocketConnection.processFrame (/home/kassem/tfgrid-sdk-ts/node_modules/websocket/lib/WebSocketConnection.js:554:26)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@0oM4R 0oM4R moved this from In Progress to Verification in 3.11.x Jun 7, 2023
@mohamedamer453
Copy link
Contributor Author

i tried to delete a contract in grace period and it doesn't get stuck anymore. and it looked like it was deleted but when i navigated to the deployments page then to the contracts page it appeared again. but after reloading the page it disappeared from the list.

screencast-from-12-06-23-14-34-01_SW8GS9HK.mp4

also another question related to this. is it allowed to delete contracts while they're in grace period?

@mohamedamer453 mohamedamer453 moved this from Verification to In Progress in 3.11.x Jun 12, 2023
@0oM4R
Copy link
Contributor

0oM4R commented Jun 12, 2023

@mohamedamer453 This is normal; deleting contracts may take a while, we add a warning before deleting to inform the user about that
yes it is allowed because if the user can't delete it the cost will keep increasing

@mohamedamer453
Copy link
Contributor Author

ok great will close it then. Thanks for the clarification.

@github-project-automation github-project-automation bot moved this from In Progress to Done in 3.11.x Jun 12, 2023
@AhmedHanafy725 AhmedHanafy725 modified the milestones: 2.1.0, 2.0.0 Jun 14, 2023
@AhmedHanafy725 AhmedHanafy725 removed this from 3.11.x Jun 14, 2023
@AhmedHanafy725 AhmedHanafy725 moved this to Done in 3.10.x Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants