Dapp Bootcamp Voting: The Acher-Banger-Bankrun test fails with the non-initiator address
![Solana: anchor-bankrun test failing, not able to find initialized address [votingDapp program from the solana bootcamp]](https://oktan.codepres.ir/wp-content/uploads/2025/02/98b1fda5.png)
A recent test argument for a Vowp on Solana blockchain told an unexpected problem, making him stay. The code, specified the Voting_Dapp.Spec.s file of the Solana Bootcamp voting program, cannot initialize a crucial variable.
* The code:
imagine
import {account inf} is from ‘@slana/web3.js’;
Import {Programresults, Pubkeytoaaccount J Fom ‘Sola-Keygen/Bear-Key’;
Import {
Acultura,
CREATEBANES,
Imagination banks,
} from ‘
CONST CRANCHYADRESS = ‘YUR-CRU-CRUNCHY-DRESS-HER’; // Replace by attached
CONST CRANCHYCANDEITY = NEW ANSANDARITY (
{Ethoryity: ‘Crunchy-Authority’, Name: ‘Crispy Candidate’}
),
Export Anchorktest Anchork asynchronous function () {
CONST BAKS = Wait for CreateBanks ();
Constinning Info = new accountinfight (the key id: ‘yur-key-sore’ here ‘});
tet
CONTT Account = awaits account.loadaccount ()
if (account. Address) {
// Initially the crisp
See = Wait for the banning anchor (BAKS, Account);
console.log (result. ‘Error:’ + Series, + result.meer.Message: ‘successsss!’); ‘);
} other {
// LEAD WITHOUT EN,
launch ban (crispy address note ‘);
}
} citch (errorrr) {
Sick (Irroy Instantly Error & Error.Message.includes (‘Initial Address’)) {
spear error;
} other {
console.erro (eror (Ernic);
}
}
}
ANSDELE {
builder (acts, meme}) {
THISOTHORITY = AUTHOR;
Thise = Name = Name;
}
ASC Create () {
// Create anchoring instance
}
}
“ s
* The question:
After reviewing the code, the CRANCHYADSRSRSRI is appeared to be incomplete. The symptom variable as contest crunchress = ‘yur-crunchy-dress-sting’; ‘But there is no care to prepare to try to access.
As a result, Wan, the test, tries to create an anchor use of singing an anchor of an ancorkerae (
* The light:
To correct this, we need to insurgent “Crunchydssress”, simultaneously before. We can do this by requesting a line to configure ships or boot it with a default value. It is an update of the code:
imagine
Import {account inf} is from ‘@slana/web3.js’;
Import {Programresults, Pubkeytoaaccount J Fom ‘Sola-Keygen/Bear-Key’;
Import {
Acultura,
CREATEBANES,
Imagination banks,
} from ‘
CONST CRANCHYADRESS = ‘0xyourcrunchydressere; // Replace by attached
CONST CRANCHYCANDEITY = NEW ANSANDARITY (
{Ethoryity: ‘Crunchy-Authority’, Name: ‘Crispy Candidate’}
),
Export Anchorktest Anchork asynchronous function () {
CONST BAKS = Wait for CreateBanks ();
Constinning Info = new accountinfight (the key id: ‘yur-key-sore’ here ‘});
tet
CONTT Account = awaits account.loadaccount ()
if (account. Address) {
// Initially the crisp
See = Wait for the banning anchor (BAKS, Account);
console.log (result. ‘Error:’ + Series, + result.meer.Message: ‘successsss!’); ‘);
} other {
// LEAD WITHOUT EN,
launch ban (crispy address note ‘);
}
} citch (errorrr) {
Sick (Irroy Instantly Error & Error.Message.includes (‘Initial Address’)) {
spear error;
} other {
console.erro (eror (Ernic);
}
}
}
ANSDELE {
builder (acts, meme}) {
THISOTHORITY = AUTHOR;
DS.