Skip to content

Commit

Permalink
🐛 Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielePicco committed Feb 20, 2024
1 parent 12cd908 commit 8ace343
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 37 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,13 @@ jobs:
anchor build
anchor idl build
anchor deploy
pkill -9 -f solana-test-validator
- name: run tests
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
npm i -g @coral-xyz/anchor-cli@${{ env.anchor_version }} ts-mocha typescript
anchor test --skip-local-validator
anchor test
- name: Install the Bolt CLI and create & build a new project
run: |
Expand Down
4 changes: 2 additions & 2 deletions Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ skip-lint = false
[programs.localnet]
bolt-component = "CmP2djJgABZ4cRokm4ndxuq6LerqpNHLBsaUv2XKEJua"
bolt-system = "7X4EFsDJ5aYTcEjKzJ94rD8FRKgQeXC89fkpeTS4KaqP"
component-position = "Fn1JzzEdyb55fsyduWS94mYHizGhJZuhvjX6DVvrmGbQ"
component-velocity = "CbHEFbSQdRN4Wnoby9r16umnJ1zWbULBHg4yqzGQonU1"
position = "Fn1JzzEdyb55fsyduWS94mYHizGhJZuhvjX6DVvrmGbQ"
velocity = "CbHEFbSQdRN4Wnoby9r16umnJ1zWbULBHg4yqzGQonU1"
system-apply-velocity = "6LHhFVwif6N9Po3jHtSmMVtPjF6zRfL3xMosSzcrQAS8"
system-fly = "HT2YawJjkNmqWcLNfPAMvNsLdWwPvvvbKA5bpMw4eUpq"
system-simple-movement = "FSa6qoJXFBR3a7ThQkTAMrC15p6NkchPEjBdd4n6dXxA"
Expand Down
38 changes: 19 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/component-position/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "component-position"
name = "position"
version = "0.0.1"
description = "Created with Bolt"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "component_position"
name = "position"

[features]
no-entrypoint = []
Expand Down
4 changes: 2 additions & 2 deletions examples/component-velocity/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "component-velocity"
name = "velocity"
version = "0.0.1"
description = "Created with Bolt"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "component_velocity"
name = "velocity"

[features]
no-entrypoint = []
Expand Down
4 changes: 2 additions & 2 deletions examples/system-apply-velocity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ idl-build = ["anchor-lang/idl-build"]
[dependencies]
anchor-lang = "0.29.0"
bolt-lang = { path = "../../crates/bolt-lang" }
component-velocity = { path = "../component-velocity", features = ["cpi"]}
component-position = { path = "../component-position", features = ["cpi"]}
velocity = { path = "../component-velocity", features = ["cpi"]}
position = { path = "../component-position", features = ["cpi"]}
4 changes: 2 additions & 2 deletions examples/system-apply-velocity/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bolt_lang::*;
use component_position::Position;
use component_velocity::Velocity;
use position::Position;
use velocity::Velocity;

declare_id!("6LHhFVwif6N9Po3jHtSmMVtPjF6zRfL3xMosSzcrQAS8");

Expand Down
2 changes: 1 addition & 1 deletion examples/system-fly/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ idl-build = ["anchor-lang/idl-build"]
[dependencies]
anchor-lang = { version = "0.29.0" }
bolt-lang = { path = "../../crates/bolt-lang" }
component-position = { path = "../component-position", features = ["cpi"]}
position = { path = "../component-position", features = ["cpi"]}


2 changes: 1 addition & 1 deletion examples/system-fly/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bolt_lang::*;
use component_position::Position;
use position::Position;

declare_id!("HT2YawJjkNmqWcLNfPAMvNsLdWwPvvvbKA5bpMw4eUpq");

Expand Down
11 changes: 6 additions & 5 deletions tests/bolt.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as anchor from "@coral-xyz/anchor";
import { type Program } from "@coral-xyz/anchor";
import { PublicKey } from "@solana/web3.js";
import { type ComponentPosition } from "../target/types/component_position";
import { type ComponentVelocity } from "../target/types/component_velocity";
import { type PublicKey } from "@solana/web3.js";
import { type Position } from "../target/types/position";
import { type Velocity } from "../target/types/velocity";
import { type BoltComponent } from "../target/types/bolt_component";
import { type SystemSimpleMovement } from "../target/types/system_simple_movement";
import { type SystemFly } from "../target/types/system_fly";
Expand All @@ -16,6 +16,7 @@ import {
FindEntityPda,
FindWorldPda,
FindWorldRegistryPda,
SYSVAR_INSTRUCTIONS_PUBKEY,
} from "../clients/bolt-sdk";

enum Direction {
Expand All @@ -42,9 +43,9 @@ describe("bolt", () => {

const worldProgram = anchor.workspace.World as Program<World>;
const boltComponentPositionProgram = anchor.workspace
.ComponentPosition as Program<ComponentPosition>;
.Position as Program<Position>;
const boltComponentVelocityProgram = anchor.workspace
.ComponentVelocity as Program<ComponentVelocity>;
.Velocity as Program<Velocity>;
const boltComponentProgramOrigin = anchor.workspace
.BoltComponent as Program<BoltComponent>;

Expand Down

0 comments on commit 8ace343

Please sign in to comment.