Skip to content

Commit

Permalink
using seeds for velocity component
Browse files Browse the repository at this point in the history
  • Loading branch information
crypto-vincent committed Jun 17, 2024
1 parent ef603a4 commit 6743950
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions tests/bolt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe("bolt", () => {
let componentPositionEntity5Pda: PublicKey;
let componentVelocityEntity1Pda: PublicKey;

it("InitializeWorldsRegistry", async () => {
it("InitializeRegistry", async () => {
const registryPda = FindRegistryPda({});
const initializeRegistryIx = createInitializeRegistryInstruction({
registry: registryPda,
Expand Down Expand Up @@ -207,6 +207,7 @@ describe("bolt", () => {
payer: provider.wallet.publicKey,
entity: entity1Pda,
componentId: exampleComponentVelocity.programId,
seed: "component-velocity",
});
await provider.sendAndConfirm(initializeComponent.transaction);
});
Expand Down Expand Up @@ -319,7 +320,10 @@ describe("bolt", () => {
{
entity: entity1Pda,
components: [
{ componentId: exampleComponentVelocity.programId },
{
componentId: exampleComponentVelocity.programId,
seed: "component-velocity",
},
{ componentId: exampleComponentPosition.programId },
],
},
Expand Down Expand Up @@ -353,7 +357,10 @@ describe("bolt", () => {
{
entity: entity1Pda,
components: [
{ componentId: exampleComponentVelocity.programId },
{
componentId: exampleComponentVelocity.programId,
seed: "component-velocity",
},
{ componentId: exampleComponentPosition.programId },
],
},
Expand Down Expand Up @@ -440,10 +447,10 @@ describe("bolt", () => {
// Check illegal call, without CPI
it("Check invalid update without CPI", async () => {
let invalid = false;
const componentVelocityEntity5 = FindComponentPda(
exampleComponentVelocity.programId,
entity5Pda
);
const componentVelocityEntity5 = FindComponentPda({
componentId: exampleComponentVelocity.programId,
entity: entity5Pda,
});
try {
await boltComponentProgram.methods
.update(null)
Expand Down

0 comments on commit 6743950

Please sign in to comment.