Skip to content

Commit

Permalink
fix: 🐛 update failed test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
iamnamananand996 committed Nov 6, 2024
1 parent f05556d commit 10dd493
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use bolt_lang::*;

#[component_deserialize]
pub struct ComponentBFP9ZBhDUUJUsnpCiobdgVsXGZsZaCXiBHGmqnYeKszj {
pub x: i64,
pub y: i64,
pub z: i64,
}

pub use ComponentBFP9ZBhDUUJUsnpCiobdgVsXGZsZaCXiBHGmqnYeKszj as Position;
13 changes: 11 additions & 2 deletions tests/bolt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ describe("bolt", () => {
seed: "origin-component",
componentId: boltComponentProgram.programId,
});
await provider.sendAndConfirm(initializeComponent.transaction);
try {
await provider.sendAndConfirm(initializeComponent.transaction);
} catch (error) {
expect(error.message).to.contain("Error Code: MustBeCalledViaCpi");
}
});

it("Initialize Original Component on Entity 2, through the world instance", async () => {
Expand All @@ -250,7 +254,12 @@ describe("bolt", () => {
seed: "origin-component",
componentId: boltComponentProgram.programId,
});
await provider.sendAndConfirm(initializeComponent.transaction);

try {
await provider.sendAndConfirm(initializeComponent.transaction);
} catch (error) {
expect(error.message).to.contain("Error Code: MustBeCalledViaCpi");
}
});

it("Initialize Position Component on Entity 1", async () => {
Expand Down

0 comments on commit 10dd493

Please sign in to comment.