
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
anchor-bankrun
Advanced tools
`anchor-bankrun` is a small but powerful extension to [solana-bankrun](https://github.com/kevinheavey/solana-bankrun) that enables using both Anchor and Bankrun with only a one-line code change. It does this by exporting a `BankrunProvider` class that can
anchor-bankrun
is a small but powerful extension to solana-bankrun
that enables using both Anchor and Bankrun with only a one-line code change. It does this by exporting a BankrunProvider
class that can be used as a drop-in replacement for AnchorProvider
during testing.
Recent versions of anchor-bankrun
use the Anchor v0.30 IDL, which is not backwards compatible with older Anchor IDLs.
If you have an older IDL, use anchor-bankrun
v0.3.0.
Here's an example using BankrunProvider
to test an Anchor program:
import { BankrunProvider, startAnchor } from "anchor-bankrun";
import { Keypair, PublicKey } from "@solana/web3.js";
import { BN, Program } from "@coral-xyz/anchor";
import { Puppet } from "./anchor-example/puppet";
const IDL = require("./anchor-example/puppet.json");
test("anchor", async () => {
const context = await startAnchor("tests/anchor-example", [], []);
const provider = new BankrunProvider(context);
const puppetProgram = new Program<Puppet>(
IDL,
provider,
);
const puppetKeypair = Keypair.generate();
await puppetProgram.methods
.initialize()
.accounts({
puppet: puppetKeypair.publicKey,
})
.signers([puppetKeypair])
.rpc();
const data = new BN(123456);
await puppetProgram.methods
.setData(data)
.accounts({
puppet: puppetKeypair.publicKey,
})
.rpc();
const dataAccount = await puppetProgram.account.data.fetch(
puppetKeypair.publicKey,
);
expect(dataAccount.data.eq(new BN(123456)));
});
yarn add anchor-bankrun
I want to keep the Bankrun dependencies light.
FAQs
`anchor-bankrun` is a small but powerful extension to [solana-bankrun](https://github.com/kevinheavey/solana-bankrun) that enables using both Anchor and Bankrun with only a one-line code change. It does this by exporting a `BankrunProvider` class that can
The npm package anchor-bankrun receives a total of 7,167 weekly downloads. As such, anchor-bankrun popularity was classified as popular.
We found that anchor-bankrun demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.