Describe the bug
I was trying to follow the metaplex/ARCHITECTURE to go through the auction create process on the newest branch, at the step that init_vault I have find that a vault programId is required, so I assume I need to createVault first. I write a test just like js/test/actions/utility/createVault.test.ts under the test folder like this
The test Code
const {NETWORK} = require( '../utils.js');
const {NodeWallet, Connection, actions,} = require('@metaplex/js');
const {Keypair} = require("@solana/web3.js");
const run = async () => {
let secretKey = Uint8Array.from([201,162,79,172,165,174,192,100,11,66,227,92,30,6,251,238,150,68,135,102,144,122,253,15,132,30,8,197,103,68,15,43,122,217,96,105,28,50,43,80,22,229,175,115,94,1,165,67,120,112,94,166,157,208,59,94,88,241,130,111,81,228,15,1]);
let myKeypair = Keypair.fromSecretKey(secretKey);
let wallet = new NodeWallet(myKeypair);
const connection = new Connection(NETWORK);
const externalPriceAccountData = await actions.createExternalPriceAccount({ connection, wallet });
// creat
const vaultResponse = await actions.createVault({
connection,
wallet,
...externalPriceAccountData,
});
console.log("vaultResponse :" +JSON.stringify(vaultResponse));
};
run();
Expected behavior
I want it to return the vault I just create to continue the process how ever I got an error like this
Screenshots
Transaction simulation failed: Error processing Instruction 7: Program failed to complete
Program 11111111111111111111111111111111 invoke [1]
Program 11111111111111111111111111111111 success
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]
Program log: Instruction: InitializeMint
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2457 of 200000 compute units
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
Program 11111111111111111111111111111111 invoke [1]
Program 11111111111111111111111111111111 success
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]
Program log: Instruction: InitializeAccount
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3394 of 200000 compute units
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
Program 11111111111111111111111111111111 invoke [1]
Program 11111111111111111111111111111111 success
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]
Program log: Instruction: InitializeAccount
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3294 of 200000 compute units
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
Program 11111111111111111111111111111111 invoke [1]
Program 11111111111111111111111111111111 success
Program vau1zxA2LbssAUEF7Gpw91zMM1LvXrvpzJtmZ58rPsn invoke [1]
Program log: Instruction: Init Vault
Program log: libstd rust_begin_panic
Program log: panicked at 'index out of bounds: the len is 0 but the index is 0', token-vault/program/src/utils.rs:255:9
Program vau1zxA2LbssAUEF7Gpw91zMM1LvXrvpzJtmZ58rPsn consumed 7621 of 200000 compute units
Program failed to complete: BPF program panicked
Program vau1zxA2LbssAUEF7Gpw91zMM1LvXrvpzJtmZ58rPsn failed: Program failed to complete
(node:11584) UnhandledPromiseRejectionWarning: Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 7: Program failed to complete
at Connection.sendEncodedTransaction (D:\solona\node_modules@solana\web3.js\lib\index.cjs.js:6634:13)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Connection.sendRawTransaction (D:\solona\node_modules@solana\web3.js\lib\index.cjs.js:6593:20)
(Use node --trace-warnings ...
to show where the warning was created)
(node:11584) 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: 2)
(node:11584) [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.
Desktop (please complete the following information):
- OS: Windows 10
- Nodejs :v14.17.6
Additional context
I install the metaplex store as well and find out the param on that one is almost the same but the creatVault work on the store, I wonder am I doing anything wrong.