inkdevhub / swanky-cli

The all-in-one developer environment for Parity pallet-contracts based smart contracts!
https://docs.astar.network/docs/build/wasm/swanky-suite/cli/
MIT License
70 stars 29 forks source link

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

Closed chunteng-web3 closed 1 year ago

chunteng-web3 commented 1 year ago

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

codespool commented 1 year ago

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