inkdevhub/marketplace

Substrate node

Closed this issue · 3 comments

Is this compatible with Substrate node?

My node is running and all installation is completed. However, when run yarn test I failed all of the cases.

Marketplace tests
2023-01-27 21:36:24 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
1) setup and mint works
2023-01-27 21:36:25 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
2) setMarketplaceFee works
2023-01-27 21:36:25 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
3) register contract works for the Marketplace owner
2023-01-27 21:36:25 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
4) register contract fails if fee is too high
2023-01-27 21:36:25 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
5) list / unlist works
2023-01-27 21:36:25 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
6) list fails if not a nft owner
2023-01-27 21:36:25 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
7) list fails if token is already listed
2023-01-27 21:36:25 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
8) unlist fails if token is not listed
2023-01-27 21:36:25 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
9) buy works
2023-01-27 21:36:26 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
10) setContractMetadata works
2023-01-27 21:36:26 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
11) setContractMetadata returns error if no contract
2023-01-27 21:36:26 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
12) setNftContractHash works
2023-01-27 21:36:26 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
13) setNftContractHash fails if not an owner
2023-01-27 21:36:26 API/INIT: RPC methods not decorated: transaction_unstable_submitAndWatch, transaction_unstable_unwatch
14) factory works
0 passing (2s)
14 failing

  1. Marketplace tests
    setup and mint works:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context. (tests/marketplace.spec.ts:73:5)

  2. Marketplace tests
    setMarketplaceFee works:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context. (tests/marketplace.spec.ts:82:5)

  3. Marketplace tests
    register contract works for the Marketplace owner:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context. (tests/marketplace.spec.ts:90:5)

  4. Marketplace tests
    register contract fails if fee is too high:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at processImmediate (node:internal/timers:446:9)
    at async Context. (tests/marketplace.spec.ts:101:5)

  5. Marketplace tests
    list / unlist works:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context. (tests/marketplace.spec.ts:111:5)

  6. Marketplace tests
    list fails if not a nft owner:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context. (tests/marketplace.spec.ts:132:5)

  7. Marketplace tests
    list fails if token is already listed:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context. (tests/marketplace.spec.ts:144:5)

  8. Marketplace tests
    unlist fails if token is not listed:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context. (tests/marketplace.spec.ts:159:5)

  9. Marketplace tests
    buy works:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context. (tests/marketplace.spec.ts:171:5)

  10. Marketplace tests
    setContractMetadata works:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context. (tests/marketplace.spec.ts:217:5)

  11. Marketplace tests
    setContractMetadata returns error if no contract:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context. (tests/marketplace.spec.ts:229:5)

  12. Marketplace tests
    setNftContractHash works:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context. (tests/marketplace.spec.ts:239:5)

  13. Marketplace tests
    setNftContractHash fails if not an owner:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at processImmediate (node:internal/timers:446:9)
    at async Context. (tests/marketplace.spec.ts:251:5)

  14. Marketplace tests
    factory works:
    Error: The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit
    at new Base (node_modules/@polkadot/api-contract/cjs/base/Base.js:17:13)
    at new Code (node_modules/@polkadot/api-contract/cjs/base/Code.js:29:5)
    at new CodePromise (node_modules/@polkadot/api-contract/cjs/promise/index.js:20:5)
    at Constructors.new (types/constructors/marketplace.ts:32:16)
    at setup (tests/marketplace.spec.ts:61:59)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Context. (tests/marketplace.spec.ts:262:5)

error Command failed with exit code 14.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

It looks to me that your node doesn't have pallet contracts running. The pallet is responsible for running WASM smart contracts in Substrate node.
Please try running contract tests against Swanky node. The Swanky node is specially tailored for WASM contracts testing.

@goheesheng can I close this ticket or you still have the issue?

Closed the issue as non active for some time