anchor
anchor copied to clipboard
anchor test for basic-1 error
basic-1 1) Creates and initializes an account in a single atomic transaction (simplified) 2) Updates a previously created account 3) Increment 4) Decrement
0 passing (30s) 4 failing
-
basic-1 Creates and initializes an account in a single atomic transaction (simplified): Error: Transaction was not confirmed in 30.02 seconds. It is unknown if it succeeded or failed. Check signature 4VBPPd6Djpuf1vYwAbtJt8sbWr5YEpnjLCWP1UXG9XsXAeHpuAt8bntsPg3AoK18QAfK6mYtjX2sfrET5HoNsBDB using the Solana Explorer or CLI tools. at Connection.confirmTransaction (/home/eddie/Summer22/anchor/examples/tutorial/node_modules/@project-serum/anchor/node_modules/@solana/web3.js/lib/index.cjs.js:5689:13) at async sendAndConfirmRawTransaction (/home/eddie/Summer22/anchor/examples/tutorial/node_modules/@project-serum/anchor/dist/cjs/provider.js:174:21) at async AnchorProvider.sendAndConfirm (/home/eddie/Summer22/anchor/examples/tutorial/node_modules/@project-serum/anchor/dist/cjs/provider.js:89:20) at async Object.rpc [as initialize] (/home/eddie/Summer22/anchor/examples/tutorial/node_modules/@project-serum/anchor/dist/cjs/program/namespace/rpc.js:15:24) at async Context.
(tests/basic-1.js:24:5) -
basic-1 Updates a previously created account: TypeError: Cannot read properties of null (reading 'publicKey') at Context.
(tests/basic-1.js:55:30) at processImmediate (node:internal/timers:466:21) -
basic-1 Increment: TypeError: Cannot read properties of null (reading 'publicKey') at Context.
(tests/basic-1.js:79:30) at processImmediate (node:internal/timers:466:21) -
basic-1 Decrement: ReferenceError: decrement is not defined at Context.
(tests/basic-1.js:101:5)
error Command failed with exit code 4. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
dont know how to fix this... please help
cargo clean
yarn install
npm install
anchor build
Replace the id
anchor test
basic-1
tests have been updated after this issue(https://github.com/coral-xyz/anchor/blob/fdda604d41837f1e04c3cae2da0b335ddc397c43/examples/tutorial/basic-1/tests/basic-1.js) and we also test it in our CI:
https://github.com/coral-xyz/anchor/blob/fdda604d41837f1e04c3cae2da0b335ddc397c43/.github/workflows/reusable-tests.yaml#L154
so the problem should be fixed now.