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

[BUG]Unable to swanky contract deploy with correct --gas #161

Closed
chunteng-web3 opened this issue May 19, 2023 · 1 comment · Fixed by #166
Closed

[BUG]Unable to swanky contract deploy with correct --gas #161

chunteng-web3 opened this issue May 19, 2023 · 1 comment · Fixed by #166
Labels
bug Something isn't working

Comments

@chunteng-web3
Copy link

Description

Currently swanky-cli is not properly deploying a_token while I can successfully deploy it on Contracts-UI-substrate.

vscode ➜ /host-home/sio2-ink-protocol (main) $ swanky contract deploy a_token --account alice -g 1000000000000 -a 1000 aDai aDai 3
✔ Initialising OK
✔ Getting WASM OK
✔ Connecting to node OK
⠋ Deployingerror: system.ExtrinsicFailed contracts.OutOfGas
TypeError: Cannot read properties of undefined (reading 'contract')
    at /opt/swanky/node_modules/@astar-network/swanky-core/dist/lib/deploy-api.js:27:39
    at /opt/swanky/node_modules/@astar-network/swanky-core/dist/lib/substrate-api.js:117:17
    at /opt/swanky/node_modules/@polkadot/api/cjs/promise/decorateMethod.js:60:40
    at /opt/swanky/node_modules/@polkadot/util/cjs/nextTick.js:16:13
Error: Unable to get the contract address
    at /opt/swanky/node_modules/@astar-network/swanky-core/dist/lib/deploy-api.js:26:32
    at /opt/swanky/node_modules/@astar-network/swanky-core/dist/lib/substrate-api.js:117:17
    at /opt/swanky/node_modules/@polkadot/api/cjs/promise/decorateMethod.js:60:40
    at /opt/swanky/node_modules/@polkadot/util/cjs/nextTick.js:16:13
✖ Error Deploying
vscode ➜ /host-home/sio2-ink-protocol (main) $ swanky contract deploy a_token --account alice -g 10000000000000 -a 1000 aDai aDai 3
✔ Initialising OK
✔ Getting WASM OK
✔ Connecting to node OK
⠋ Deploying2023-05-19 20:25:14        RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1010: Invalid Transaction: Transaction would exhaust the block limits
2023-05-19 20:25:14        RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1010: Invalid Transaction: Transaction would exhaust the block limits
/opt/swanky/node_modules/@polkadot/rpc-provider/cjs/coder/index.js:24
        throw new error_1.default(`${code}: ${message}${formatErrorData(data)}`, code, data);
              ^

RpcError: 1010: Invalid Transaction: Transaction would exhaust the block limits
    at checkError (/opt/swanky/node_modules/@polkadot/rpc-provider/cjs/coder/index.js:24:15)
    at RpcCoder.decodeResponse (/opt/swanky/node_modules/@polkadot/rpc-provider/cjs/coder/index.js:42:9)
    at WsProvider.<anonymous> (/opt/swanky/node_modules/@polkadot/rpc-provider/cjs/ws/index.js:143:93)
    at WebSocket.<anonymous> (/opt/swanky/node_modules/@polkadot/rpc-provider/cjs/ws/index.js:132:96)
    at callListener (/opt/swanky/node_modules/ws/lib/event-target.js:290:14)
    at WebSocket.onMessage (/opt/swanky/node_modules/ws/lib/event-target.js:209:9)
    at WebSocket.emit (node:events:513:28)
    at Receiver.receiverOnMessage (/opt/swanky/node_modules/ws/lib/websocket.js:1184:20)
    at Receiver.emit (node:events:513:28)
    at Receiver.dataMessage (/opt/swanky/node_modules/ws/lib/receiver.js:541:14)

As such, I won't be able to properly register deployed contracts to swanky.config.json, making it difficult to parse deployed contracts for tests.

Attaching screenshots of successful deployments on Constract-UI-substrate

Image

@chunteng-web3 chunteng-web3 added the bug Something isn't working label May 19, 2023
@chunteng-web3 chunteng-web3 changed the title [BUG] [BUG]Unable to swanky contract deploy with correct --gas May 19, 2023
@codespool
Copy link
Collaborator

Thanks for reporting.
I believe this will be solved by #154
We'll prioritise that one in the current sprint.

codespool added a commit that referenced this issue May 30, 2023
This fixes #161 

- add `WeightV2` type construct to deploy command
- make maxGas flag optional
- some small changes to the test template. (doesn't change how it works,
just locks the mocharc file to the one in the root directory, and
prevents it from looking into parent dir)

Will be promoted from draft after #165 is merged and this rebased to
master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants