Skip to content

Commit

Permalink
♻️ Refactor & Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielePicco committed Feb 15, 2024
1 parent 8ae5ae6 commit 8d5ac38
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ jobs:
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
ls node_modules/.bin
npm i -g @coral-xyz/anchor-cli@${{ env.anchor_version }} ts-mocha typescript
anchor build
solana-test-validator > /dev/null &
sleep 5
anchor idl build
anchor deploy
- name: run tests
run: anchor test
Expand Down
2 changes: 1 addition & 1 deletion Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bolt-system = "7X4EFsDJ5aYTcEjKzJ94rD8FRKgQeXC89fkpeTS4KaqP"
component-position = "Fn1JzzEdyb55fsyduWS94mYHizGhJZuhvjX6DVvrmGbQ"
component-velocity = "CbHEFbSQdRN4Wnoby9r16umnJ1zWbULBHg4yqzGQonU1"
system-apply-velocity = "6LHhFVwif6N9Po3jHtSmMVtPjF6zRfL3xMosSzcrQAS8"
system-fly = "BAQXfRwpNE43pdkeajsffA4rEkFQxwmUEDZKJjQHuvAN"
system-fly = "HT2YawJjkNmqWcLNfPAMvNsLdWwPvvvbKA5bpMw4eUpq"
system-simple-movement = "FSa6qoJXFBR3a7ThQkTAMrC15p6NkchPEjBdd4n6dXxA"
world = "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"

Expand Down
3 changes: 2 additions & 1 deletion crates/bolt-lang/attribute/component/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ pub fn component(attr: TokenStream, item: TokenStream) -> TokenStream {

let name = &input.ident;
let component_name = syn::Ident::new(&name.to_string().to_lowercase(), input.ident.span());
let mod_name = syn::Ident::new(&format!("component_{}", component_name), input.ident.span());

let anchor_program = quote! {
#[bolt_program(#name)]
pub mod #component_name {
pub mod #mod_name {
use super::*;
}
};
Expand Down
8 changes: 4 additions & 4 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 Position } from "../target/types/position";
import { type Velocity } from "../target/types/velocity";
import { type ComponentPosition } from "../target/types/component_position";
import { type ComponentVelocity } from "../target/types/component_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 Down Expand Up @@ -45,9 +45,9 @@ describe("bolt", () => {

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

Expand Down

0 comments on commit 8d5ac38

Please sign in to comment.