acceleration.ts 902 B

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