diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a95209c8a..77b850e90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,7 @@ jobs: - uses: actions/checkout@v2 - name: Yarn install dependencies run: | + n v14.18.1 yarn yarn add ts-node - name: Redspot Сompile @@ -46,7 +47,7 @@ jobs: yarn build:release - name: Run Test Mocha run: | - substrate-contracts-node --tmp --dev -lerror,runtime::contracts=debug,info,error,warning & P1=$! + substrate-contracts-node --tmp --dev & P1=$! yarn test:mocha & P2=$! wait $P2 kill $P1 diff --git a/package.json b/package.json index a05b8d983..02cd3bb08 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,9 @@ "@babel/plugin-transform-runtime": "^7.14.2", "@babel/preset-env": "^7.7.4", "@babel/register": "^7.7.4", - "@redspot/patract": "^0.13.5", - "@redspot/gas-reporter": "^0.13.5", "@redspot/chai": "^0.13.4", + "@redspot/gas-reporter": "^0.13.5", + "@redspot/patract": "^0.13.5", "@types/chai": "^4.3.0", "@types/chai-as-promised": "^7.1.5", "@types/mocha": "^8.0.3", @@ -21,13 +21,14 @@ "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^5.1.0", - "redspot": "^0.13.5" + "redspot": "^0.13.5", + "ts-node": "^10.8.0" }, "scripts": { "build:release": "npx redspot compile --release", "build": "npx redspot compile", "test:redspot": "npx redspot test", - "test:mocha": "mocha --require @babel/register --require ts-node/register --require ./tests/setup/hooks.ts --recursive ./tests --extension \".ts\" --exit --timeout 20000", + "test:mocha": "mocha --require @babel/register --require ts-node/register --recursive ./tests --extension \".ts\" --exit --timeout 20000", "test": "yarn build:release && yarn test:mocha" } } diff --git a/tests/helpers.ts b/tests/helpers.ts index ceb47f812..41059f66a 100644 --- a/tests/helpers.ts +++ b/tests/helpers.ts @@ -52,7 +52,14 @@ export const setupProxy = (contract, proxy): Contract => { return patchContractMethods(proxied_contract); } +function timeout(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + export const setupContract = async (name, constructor, ...args) => { + await api.disconnect(); + await timeout(100); + await api.connect(); const one = new BN(10).pow(new BN(api.registry.chainDecimals[0])) const signers = await getSigners() const defaultSigner = await getRandomSigner(signers[0], one.muln(10)) diff --git a/tests/setup/hooks.ts b/tests/setup/hooks.ts deleted file mode 100644 index fc65f01c0..000000000 --- a/tests/setup/hooks.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { network } from 'redspot' - -const { api } = network - -export const mochaHooks = { - afterAll: () => { - api.disconnect() - } -} diff --git a/utils/brush_lang/proc_macros/internal.rs b/utils/brush_lang/proc_macros/internal.rs index e4b911cf8..25c217a2b 100644 --- a/utils/brush_lang/proc_macros/internal.rs +++ b/utils/brush_lang/proc_macros/internal.rs @@ -212,8 +212,10 @@ pub(crate) fn impl_external_trait( .unwrap(), ); let mut attrs = method.attrs.clone(); - method.attrs = extract_attr(&mut attrs, "doc"); - method.attrs = extract_attr(&mut attrs, "ink"); + method.attrs = [extract_attr(&mut attrs, "doc"), extract_attr(&mut attrs, "ink")] + .into_iter() + .flatten() + .collect(); ink_methods.insert(method.sig.ident.to_string(), method); } });