I have a query like I have deployed a token on mainnet and has declared that token on the anchor contracts. Now I want to know the best practices such that I can test in locally using anchor test . Previously I was using this in local testnet to extract mainnet information locally
const connection_mainnet = new Connection(clusterApiUrl('mainnet-beta'),'confirmed');
tokenMainPubkey = new anchor.web3.PublicKey("tokenPubkey")
let accountInfo = await connection_mainnet.getParsedAccountInfo(tokenMainPubkey);
const tokenAccountInfo = await connection_mainnet.getAccountInfo(tokenMainPubkey);
console.log("token account info",tokenAccountInfo)
And this want returning me the mainnet information
But when I am using this on my initialize function so it and run test case, it returns this error
Error
Error: AnchorError caused by account: tai_mint. Error Code: AccountNotInitialized. Error Number: 3012. Error Message: The program expected this account to be already initialized.