acceleration.ts 985 B

12345678910111213141516171819202122232425262728
  1. import {
  2. anchor,
  3. DelegateComponent,
  4. DELEGATION_PROGRAM_ID,
  5. } from "../../clients/bolt-sdk/lib";
  6. import { expect } from "chai";
  7. export function acceleration(framework) {
  8. describe("Acceleration", () => {
  9. it("Check component delegation to accelerator", async () => {
  10. const delegateComponent = await DelegateComponent({
  11. payer: framework.provider.wallet.publicKey,
  12. entity: framework.entity1Pda,
  13. componentId: framework.exampleComponentPosition.programId,
  14. });
  15. const instruction = delegateComponent.transaction;
  16. const transaction = new anchor.web3.Transaction().add(instruction);
  17. await framework.provider.sendAndConfirm(transaction, [], {
  18. skipPreflight: true,
  19. commitment: "confirmed",
  20. });
  21. const acc = await framework.provider.connection.getAccountInfo(
  22. delegateComponent.componentPda,
  23. );
  24. expect(acc?.owner.toBase58()).to.equal(DELEGATION_PROGRAM_ID.toBase58());
  25. });
  26. });
  27. }