Skip to content

Commit 10dd493

Browse files
fix: 🐛 update failed test cases
1 parent f05556d commit 10dd493

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use bolt_lang::*;
2+
3+
#[component_deserialize]
4+
pub struct ComponentBFP9ZBhDUUJUsnpCiobdgVsXGZsZaCXiBHGmqnYeKszj {
5+
pub x: i64,
6+
pub y: i64,
7+
pub z: i64,
8+
}
9+
10+
pub use ComponentBFP9ZBhDUUJUsnpCiobdgVsXGZsZaCXiBHGmqnYeKszj as Position;

tests/bolt.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,11 @@ describe("bolt", () => {
240240
seed: "origin-component",
241241
componentId: boltComponentProgram.programId,
242242
});
243-
await provider.sendAndConfirm(initializeComponent.transaction);
243+
try {
244+
await provider.sendAndConfirm(initializeComponent.transaction);
245+
} catch (error) {
246+
expect(error.message).to.contain("Error Code: MustBeCalledViaCpi");
247+
}
244248
});
245249

246250
it("Initialize Original Component on Entity 2, through the world instance", async () => {
@@ -250,7 +254,12 @@ describe("bolt", () => {
250254
seed: "origin-component",
251255
componentId: boltComponentProgram.programId,
252256
});
253-
await provider.sendAndConfirm(initializeComponent.transaction);
257+
258+
try {
259+
await provider.sendAndConfirm(initializeComponent.transaction);
260+
} catch (error) {
261+
expect(error.message).to.contain("Error Code: MustBeCalledViaCpi");
262+
}
254263
});
255264

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

0 commit comments

Comments
 (0)