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

Can't run tests in dev environment #1422

Open
Guitlle opened this issue Jan 7, 2022 · 2 comments
Open

Can't run tests in dev environment #1422

Guitlle opened this issue Jan 7, 2022 · 2 comments

Comments

@Guitlle
Copy link

Guitlle commented Jan 7, 2022

I wanted to learn from this repo so I cloned it but I couldn't pass from running tests. It seems to work with node 14 ( I couldn't use version 12). I did

yarn
yarn test:finance

and I got this error:

    Contract: Finance App
    Solidity stack traces only work with Solidity version 0.5.1 or higher.
        ✓ initialized first accounting period and settings (95ms)
        ✓ sets the end of time correctly (2870ms)
    (node:491653) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1050)
    (node:491653) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
        1) fails on reinitialization
        2) "before each" hook for "cannot initialize base app"


    2 passing (34s)
    2 failing


..../aragon-apps/node_modules/hardhat/internal/hardhat-network/stack-traces/solidity-errors.js:108
    return new SolidityCallSite(sourceReference.file.sourceName, sourceReference.contract, sourceReference.function !== undefined
                                                ^

TypeError: Cannot read property 'file' of undefined
(Use `node --trace-uncaught ...` to show where the exception was thrown)
npm ERR! code ELIFECYCLE

Any thoughts? What am I doing wrong?

@welcome
Copy link

welcome bot commented Jan 7, 2022

Thanks for opening your first issue in the Aragon apps repo! Someone will circle back soon ⚡

@Guitlle
Copy link
Author

Guitlle commented Jan 7, 2022

I went to ..../aragon-apps/node_modules/hardhat/internal/hardhat-network/stack-traces/solidity-errors.js:108 and modified this function to this:

function sourceReferenceToSolidityCallsite(sourceReference) {
    if (sourceReference === undefined) {
        console.trace("DEBUG undefined source ref");
    }
    return new SolidityCallSite(sourceReference.file.sourceName, sourceReference.contract, sourceReference.function !== undefined
        ? sourceReference.function
        : solidity_stack_trace_1.UNKNOWN_FUNCTION_NAME, sourceReference.line);
}

Got this trace repeated several times:

Trace: DEBUG undefined source ref
    at sourceReferenceToSolidityCallsite (.../aragon-apps/node_modules/hardhat/internal/hardhat-network/stack-traces/solidity-errors.js:112:17)
    at encodeStackTraceEntry (.../aragon-apps/node_modules/hardhat/internal/hardhat-network/stack-traces/solidity-errors.js:82:20)
    at Function.Error.prepareStackTrace (.../aragon-apps/node_modules/hardhat/internal/hardhat-network/stack-traces/solidity-errors.js:47:30)
    at maybeOverridePrepareStackTrace (internal/errors.js:127:29)
    at prepareStackTrace (internal/errors.js:106:5)
    at Object.get (.../aragon-apps/node_modules/@nomiclabs/buidler/internal/util/lazy.js:133:39)
    at Web3HTTPProviderAdapter._sendJsonRpcRequest (.../aragon-apps/node_modules/@nomiclabs/buidler-web3/dist/web3-provider-adapter.js:41:49)
    at .../aragon-apps/node_modules/@nomiclabs/buidler-web3/dist/web3-provider-adapter.js:17:51
    at Callbackified (util.js:293:5)
    at Web3HTTPProviderAdapter.send (.../aragon-apps/node_modules/@nomiclabs/buidler-web3/dist/web3-provider-adapter.js:17:80)
    at RequestManager.send (.../aragon-apps/node_modules/@nomiclabs/truffle-contract/node_modules/web3-core-requestmanager/lib/index.js:162:23)
    at sendRequest (.../aragon-apps/node_modules/@nomiclabs/truffle-contract/node_modules/web3-core-method/lib/index.js:615:42)
    at Object.send [as getBlockByNumber] (.../aragon-apps/node_modules/@nomiclabs/truffle-contract/node_modules/web3-core-method/lib/index.js:642:13)
    at .../aragon-apps/node_modules/@nomiclabs/truffle-contract/node_modules/web3-core-method/lib/index.js:265:63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant